/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('account-crm', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AccountOneKeyDeleteRequest {
  appName?: string(name='AppName'),
  pk?: string(name='Pk'),
}

model AccountOneKeyDeleteResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AccountOneKeyDeleteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AccountOneKeyDeleteResponseBody(name='body'),
}

async function accountOneKeyDeleteWithOptions(request: AccountOneKeyDeleteRequest, runtime: Util.RuntimeOptions): AccountOneKeyDeleteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AccountOneKeyDelete',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function accountOneKeyDelete(request: AccountOneKeyDeleteRequest): AccountOneKeyDeleteResponse {
  var runtime = new Util.RuntimeOptions{};
  return accountOneKeyDeleteWithOptions(request, runtime);
}

model AddCustomerLabelRequest {
  endtime?: string(name='Endtime'),
  labelSeries?: string(name='LabelSeries'),
  labelTypes?: [ string ](name='LabelTypes'),
  organization?: string(name='Organization'),
  PK?: long(name='PK'),
  startTime?: string(name='StartTime'),
  token?: string(name='Token'),
  userName?: string(name='UserName'),
}

model AddCustomerLabelResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AddCustomerLabelResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddCustomerLabelResponseBody(name='body'),
}

async function addCustomerLabelWithOptions(request: AddCustomerLabelRequest, runtime: Util.RuntimeOptions): AddCustomerLabelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.endtime)) {
    query['Endtime'] = request.endtime;
  }
  if (!Util.isUnset(request.labelSeries)) {
    query['LabelSeries'] = request.labelSeries;
  }
  if (!Util.isUnset(request.labelTypes)) {
    query['LabelTypes'] = request.labelTypes;
  }
  if (!Util.isUnset(request.organization)) {
    query['Organization'] = request.organization;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddCustomerLabel',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addCustomerLabel(request: AddCustomerLabelRequest): AddCustomerLabelResponse {
  var runtime = new Util.RuntimeOptions{};
  return addCustomerLabelWithOptions(request, runtime);
}

model AllowAgAccountLoginRequest {
  agAccountType?: string(name='AgAccountType'),
  appName?: string(name='AppName'),
  mpk?: string(name='Mpk'),
  pk?: string(name='Pk'),
}

model AllowAgAccountLoginResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AllowAgAccountLoginResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AllowAgAccountLoginResponseBody(name='body'),
}

async function allowAgAccountLoginWithOptions(request: AllowAgAccountLoginRequest, runtime: Util.RuntimeOptions): AllowAgAccountLoginResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agAccountType)) {
    query['AgAccountType'] = request.agAccountType;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AllowAgAccountLogin',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function allowAgAccountLogin(request: AllowAgAccountLoginRequest): AllowAgAccountLoginResponse {
  var runtime = new Util.RuntimeOptions{};
  return allowAgAccountLoginWithOptions(request, runtime);
}

model ApplyIdentityRegistrationRequest {
  accountType?: int32(name='AccountType'),
  customerId?: string(name='CustomerId'),
  docBackPic?: string(name='DocBackPic'),
  docFrontPic?: string(name='DocFrontPic'),
  docNum?: string(name='DocNum'),
  docType?: string(name='DocType'),
  email?: string(name='Email'),
  fullName?: string(name='FullName'),
  registeredAddress?: string(name='RegisteredAddress'),
  registeredCountry?: string(name='RegisteredCountry'),
  registeredNum?: string(name='RegisteredNum'),
  tel?: string(name='Tel'),
}

model ApplyIdentityRegistrationResponseBody = {
  code?: string(name='Code'),
  data?: long(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ApplyIdentityRegistrationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ApplyIdentityRegistrationResponseBody(name='body'),
}

async function applyIdentityRegistrationWithOptions(request: ApplyIdentityRegistrationRequest, runtime: Util.RuntimeOptions): ApplyIdentityRegistrationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountType)) {
    query['AccountType'] = request.accountType;
  }
  if (!Util.isUnset(request.customerId)) {
    query['CustomerId'] = request.customerId;
  }
  if (!Util.isUnset(request.docBackPic)) {
    query['DocBackPic'] = request.docBackPic;
  }
  if (!Util.isUnset(request.docFrontPic)) {
    query['DocFrontPic'] = request.docFrontPic;
  }
  if (!Util.isUnset(request.docNum)) {
    query['DocNum'] = request.docNum;
  }
  if (!Util.isUnset(request.docType)) {
    query['DocType'] = request.docType;
  }
  if (!Util.isUnset(request.email)) {
    query['Email'] = request.email;
  }
  if (!Util.isUnset(request.fullName)) {
    query['FullName'] = request.fullName;
  }
  if (!Util.isUnset(request.registeredAddress)) {
    query['RegisteredAddress'] = request.registeredAddress;
  }
  if (!Util.isUnset(request.registeredCountry)) {
    query['RegisteredCountry'] = request.registeredCountry;
  }
  if (!Util.isUnset(request.registeredNum)) {
    query['RegisteredNum'] = request.registeredNum;
  }
  if (!Util.isUnset(request.tel)) {
    query['Tel'] = request.tel;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ApplyIdentityRegistration',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function applyIdentityRegistration(request: ApplyIdentityRegistrationRequest): ApplyIdentityRegistrationResponse {
  var runtime = new Util.RuntimeOptions{};
  return applyIdentityRegistrationWithOptions(request, runtime);
}

model AsyncCreateAgAccountRequest {
  loginEmail?: string(name='LoginEmail'),
  maserAccountInfo?: string(name='MaserAccountInfo'),
  mpk?: string(name='Mpk'),
}

model AsyncCreateAgAccountResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceNo?: string(name='TraceNo'),
}

model AsyncCreateAgAccountResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AsyncCreateAgAccountResponseBody(name='body'),
}

async function asyncCreateAgAccountWithOptions(request: AsyncCreateAgAccountRequest, runtime: Util.RuntimeOptions): AsyncCreateAgAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.loginEmail)) {
    query['LoginEmail'] = request.loginEmail;
  }
  if (!Util.isUnset(request.maserAccountInfo)) {
    query['MaserAccountInfo'] = request.maserAccountInfo;
  }
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AsyncCreateAgAccount',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function asyncCreateAgAccount(request: AsyncCreateAgAccountRequest): AsyncCreateAgAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return asyncCreateAgAccountWithOptions(request, runtime);
}

model AsyncModifyAgLoginEmailRequest {
  mpk?: string(name='Mpk'),
  newLoginEmail?: string(name='NewLoginEmail'),
  pk?: string(name='Pk'),
}

model AsyncModifyAgLoginEmailResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceNo?: string(name='TraceNo'),
}

model AsyncModifyAgLoginEmailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AsyncModifyAgLoginEmailResponseBody(name='body'),
}

async function asyncModifyAgLoginEmailWithOptions(request: AsyncModifyAgLoginEmailRequest, runtime: Util.RuntimeOptions): AsyncModifyAgLoginEmailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.newLoginEmail)) {
    query['NewLoginEmail'] = request.newLoginEmail;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AsyncModifyAgLoginEmail',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function asyncModifyAgLoginEmail(request: AsyncModifyAgLoginEmailRequest): AsyncModifyAgLoginEmailResponse {
  var runtime = new Util.RuntimeOptions{};
  return asyncModifyAgLoginEmailWithOptions(request, runtime);
}

model AuthAndActiveWithHidRequest {
  appName?: string(name='AppName'),
  havanaId?: string(name='HavanaId'),
  sessionId?: string(name='SessionId'),
}

model AuthAndActiveWithHidResponseBody = {
  code?: string(name='Code'),
  data?: {
    accountModel?: {
      aliyunId?: string(name='AliyunId'),
      createTime?: long(name='CreateTime'),
      email?: string(name='Email'),
      havanaId?: long(name='HavanaId'),
      mobile?: string(name='Mobile'),
      PK?: string(name='PK'),
    }(name='AccountModel'),
    sessionModel?: {
      aliyunPK?: string(name='AliyunPK'),
      loginTicket?: string(name='LoginTicket'),
    }(name='SessionModel'),
  }(name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
}

model AuthAndActiveWithHidResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AuthAndActiveWithHidResponseBody(name='body'),
}

async function authAndActiveWithHidWithOptions(request: AuthAndActiveWithHidRequest, runtime: Util.RuntimeOptions): AuthAndActiveWithHidResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.havanaId)) {
    query['HavanaId'] = request.havanaId;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AuthAndActiveWithHid',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function authAndActiveWithHid(request: AuthAndActiveWithHidRequest): AuthAndActiveWithHidResponse {
  var runtime = new Util.RuntimeOptions{};
  return authAndActiveWithHidWithOptions(request, runtime);
}

model AuthAndRefreshLoginTicketRequest {
  appName?: string(name='AppName'),
  havanaId?: string(name='HavanaId'),
  sessionId?: string(name='SessionId'),
}

model AuthAndRefreshLoginTicketResponseBody = {
  code?: string(name='Code'),
  data?: {
    newLoginTicket?: string(name='NewLoginTicket'),
  }(name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
}

model AuthAndRefreshLoginTicketResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AuthAndRefreshLoginTicketResponseBody(name='body'),
}

async function authAndRefreshLoginTicketWithOptions(request: AuthAndRefreshLoginTicketRequest, runtime: Util.RuntimeOptions): AuthAndRefreshLoginTicketResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.havanaId)) {
    query['HavanaId'] = request.havanaId;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AuthAndRefreshLoginTicket',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function authAndRefreshLoginTicket(request: AuthAndRefreshLoginTicketRequest): AuthAndRefreshLoginTicketResponse {
  var runtime = new Util.RuntimeOptions{};
  return authAndRefreshLoginTicketWithOptions(request, runtime);
}

model AuthLoginTicketRequest {
  appName?: string(name='AppName'),
  authCode?: string(name='AuthCode'),
  minorAuthCode?: string(name='MinorAuthCode'),
  scene?: string(name='Scene'),
}

model AuthLoginTicketResponseBody = {
  code?: string(name='Code'),
  loginTicketDto?: {
    loginTicket?: string(name='LoginTicket'),
  }(name='LoginTicketDto'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model AuthLoginTicketResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AuthLoginTicketResponseBody(name='body'),
}

async function authLoginTicketWithOptions(request: AuthLoginTicketRequest, runtime: Util.RuntimeOptions): AuthLoginTicketResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.authCode)) {
    query['AuthCode'] = request.authCode;
  }
  if (!Util.isUnset(request.minorAuthCode)) {
    query['MinorAuthCode'] = request.minorAuthCode;
  }
  if (!Util.isUnset(request.scene)) {
    query['Scene'] = request.scene;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AuthLoginTicket',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function authLoginTicket(request: AuthLoginTicketRequest): AuthLoginTicketResponse {
  var runtime = new Util.RuntimeOptions{};
  return authLoginTicketWithOptions(request, runtime);
}

model BatchQueryAgAccountRequest {
  mpk?: string(name='Mpk'),
  pkList?: string(name='PkList'),
}

model BatchQueryAgAccountResponseBody = {
  agAccounts?: [ 
    {
      loginEmail?: string(name='LoginEmail'),
      pk?: string(name='Pk'),
    }
  ](name='AgAccounts'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model BatchQueryAgAccountResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BatchQueryAgAccountResponseBody(name='body'),
}

async function batchQueryAgAccountWithOptions(request: BatchQueryAgAccountRequest, runtime: Util.RuntimeOptions): BatchQueryAgAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.pkList)) {
    query['PkList'] = request.pkList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchQueryAgAccount',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchQueryAgAccount(request: BatchQueryAgAccountRequest): BatchQueryAgAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchQueryAgAccountWithOptions(request, runtime);
}

model BatchQueryCreateAccountTraceRequest {
  mpk?: string(name='Mpk'),
  traceNoList?: string(name='TraceNoList'),
}

model BatchQueryCreateAccountTraceResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traces?: [ 
    {
      nowLoginEmail?: string(name='NowLoginEmail'),
      pk?: string(name='Pk'),
      status?: string(name='Status'),
      traceNo?: string(name='TraceNo'),
    }
  ](name='Traces'),
}

model BatchQueryCreateAccountTraceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BatchQueryCreateAccountTraceResponseBody(name='body'),
}

async function batchQueryCreateAccountTraceWithOptions(request: BatchQueryCreateAccountTraceRequest, runtime: Util.RuntimeOptions): BatchQueryCreateAccountTraceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.traceNoList)) {
    query['TraceNoList'] = request.traceNoList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchQueryCreateAccountTrace',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchQueryCreateAccountTrace(request: BatchQueryCreateAccountTraceRequest): BatchQueryCreateAccountTraceResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchQueryCreateAccountTraceWithOptions(request, runtime);
}

model BatchQueryModifyLoginEmailTraceRequest {
  mpk?: string(name='Mpk'),
  traceNoList?: string(name='TraceNoList'),
}

model BatchQueryModifyLoginEmailTraceResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  traces?: [ 
    {
      newLoginEmail?: string(name='NewLoginEmail'),
      nowLoginEmail?: string(name='NowLoginEmail'),
      oldLoginEmail?: string(name='OldLoginEmail'),
      pk?: string(name='Pk'),
      status?: string(name='Status'),
      traceNo?: string(name='TraceNo'),
    }
  ](name='Traces'),
}

model BatchQueryModifyLoginEmailTraceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BatchQueryModifyLoginEmailTraceResponseBody(name='body'),
}

async function batchQueryModifyLoginEmailTraceWithOptions(request: BatchQueryModifyLoginEmailTraceRequest, runtime: Util.RuntimeOptions): BatchQueryModifyLoginEmailTraceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.traceNoList)) {
    query['TraceNoList'] = request.traceNoList;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'BatchQueryModifyLoginEmailTrace',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function batchQueryModifyLoginEmailTrace(request: BatchQueryModifyLoginEmailTraceRequest): BatchQueryModifyLoginEmailTraceResponse {
  var runtime = new Util.RuntimeOptions{};
  return batchQueryModifyLoginEmailTraceWithOptions(request, runtime);
}

model CancelAsyncCreateAgAccountRequest {
  mpk?: string(name='Mpk'),
  traceNo?: string(name='TraceNo'),
}

model CancelAsyncCreateAgAccountResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model CancelAsyncCreateAgAccountResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CancelAsyncCreateAgAccountResponseBody(name='body'),
}

async function cancelAsyncCreateAgAccountWithOptions(request: CancelAsyncCreateAgAccountRequest, runtime: Util.RuntimeOptions): CancelAsyncCreateAgAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.traceNo)) {
    query['TraceNo'] = request.traceNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelAsyncCreateAgAccount',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function cancelAsyncCreateAgAccount(request: CancelAsyncCreateAgAccountRequest): CancelAsyncCreateAgAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelAsyncCreateAgAccountWithOptions(request, runtime);
}

model CancelAsyncModifyLoginEmailRequest {
  mpk?: string(name='Mpk'),
  traceNo?: string(name='TraceNo'),
}

model CancelAsyncModifyLoginEmailResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model CancelAsyncModifyLoginEmailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CancelAsyncModifyLoginEmailResponseBody(name='body'),
}

async function cancelAsyncModifyLoginEmailWithOptions(request: CancelAsyncModifyLoginEmailRequest, runtime: Util.RuntimeOptions): CancelAsyncModifyLoginEmailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.traceNo)) {
    query['TraceNo'] = request.traceNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelAsyncModifyLoginEmail',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function cancelAsyncModifyLoginEmail(request: CancelAsyncModifyLoginEmailRequest): CancelAsyncModifyLoginEmailResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelAsyncModifyLoginEmailWithOptions(request, runtime);
}

model ChangeAgSecurityEmailRequest {
  appName?: string(name='AppName'),
  mpk?: string(name='Mpk'),
  pk?: string(name='Pk'),
  securityEmail?: string(name='SecurityEmail'),
}

model ChangeAgSecurityEmailResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ChangeAgSecurityEmailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ChangeAgSecurityEmailResponseBody(name='body'),
}

async function changeAgSecurityEmailWithOptions(request: ChangeAgSecurityEmailRequest, runtime: Util.RuntimeOptions): ChangeAgSecurityEmailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  if (!Util.isUnset(request.securityEmail)) {
    query['SecurityEmail'] = request.securityEmail;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeAgSecurityEmail',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function changeAgSecurityEmail(request: ChangeAgSecurityEmailRequest): ChangeAgSecurityEmailResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeAgSecurityEmailWithOptions(request, runtime);
}

model ChangeAgSecurityMobileRequest {
  appName?: string(name='AppName'),
  mpk?: string(name='Mpk'),
  pk?: string(name='Pk'),
  securityMobile?: string(name='SecurityMobile'),
}

model ChangeAgSecurityMobileResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ChangeAgSecurityMobileResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ChangeAgSecurityMobileResponseBody(name='body'),
}

async function changeAgSecurityMobileWithOptions(request: ChangeAgSecurityMobileRequest, runtime: Util.RuntimeOptions): ChangeAgSecurityMobileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  if (!Util.isUnset(request.securityMobile)) {
    query['SecurityMobile'] = request.securityMobile;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeAgSecurityMobile',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function changeAgSecurityMobile(request: ChangeAgSecurityMobileRequest): ChangeAgSecurityMobileResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeAgSecurityMobileWithOptions(request, runtime);
}

model CreateAccountProfileInfoRequest {
  accountJson?: string(name='AccountJson'),
}

model CreateAccountProfileInfoResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateAccountProfileInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAccountProfileInfoResponseBody(name='body'),
}

async function createAccountProfileInfoWithOptions(request: CreateAccountProfileInfoRequest, runtime: Util.RuntimeOptions): CreateAccountProfileInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountJson)) {
    query['AccountJson'] = request.accountJson;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAccountProfileInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAccountProfileInfo(request: CreateAccountProfileInfoRequest): CreateAccountProfileInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAccountProfileInfoWithOptions(request, runtime);
}

model CreateAgAccountRequest {
  loginEmail?: string(name='LoginEmail'),
  mpk?: string(name='Mpk'),
  nationCode?: string(name='NationCode'),
  own?: string(name='Own'),
  securityMobile?: string(name='SecurityMobile'),
}

model CreateAgAccountResponseBody = {
  agRelationDto?: {
    mpk?: string(name='Mpk'),
    pk?: string(name='Pk'),
    type?: string(name='Type'),
  }(name='AgRelationDto'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateAgAccountResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateAgAccountResponseBody(name='body'),
}

async function createAgAccountWithOptions(request: CreateAgAccountRequest, runtime: Util.RuntimeOptions): CreateAgAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.loginEmail)) {
    query['LoginEmail'] = request.loginEmail;
  }
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.nationCode)) {
    query['NationCode'] = request.nationCode;
  }
  if (!Util.isUnset(request.own)) {
    query['Own'] = request.own;
  }
  if (!Util.isUnset(request.securityMobile)) {
    query['SecurityMobile'] = request.securityMobile;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAgAccount',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAgAccount(request: CreateAgAccountRequest): CreateAgAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAgAccountWithOptions(request, runtime);
}

model CreateContacterRequest {
  contacterAddress?: string(name='ContacterAddress'),
  contacterDingding?: string(name='ContacterDingding'),
  contacterEmail?: string(name='ContacterEmail'),
  contacterMobile?: string(name='ContacterMobile'),
  contacterName?: string(name='ContacterName'),
  contacterPosition?: string(name='ContacterPosition'),
  contacterStaffNo?: string(name='ContacterStaffNo'),
  contacterType?: string(name='ContacterType'),
  contacterWangwang?: string(name='ContacterWangwang'),
  emailConfirmed?: boolean(name='EmailConfirmed'),
  mobileConfirmed?: boolean(name='MobileConfirmed'),
  userId?: long(name='UserId'),
}

model CreateContacterResponseBody = {
  code?: string(name='Code'),
  contacterId?: string(name='ContacterId'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateContacterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateContacterResponseBody(name='body'),
}

async function createContacterWithOptions(request: CreateContacterRequest, runtime: Util.RuntimeOptions): CreateContacterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contacterAddress)) {
    query['ContacterAddress'] = request.contacterAddress;
  }
  if (!Util.isUnset(request.contacterDingding)) {
    query['ContacterDingding'] = request.contacterDingding;
  }
  if (!Util.isUnset(request.contacterEmail)) {
    query['ContacterEmail'] = request.contacterEmail;
  }
  if (!Util.isUnset(request.contacterMobile)) {
    query['ContacterMobile'] = request.contacterMobile;
  }
  if (!Util.isUnset(request.contacterName)) {
    query['ContacterName'] = request.contacterName;
  }
  if (!Util.isUnset(request.contacterPosition)) {
    query['ContacterPosition'] = request.contacterPosition;
  }
  if (!Util.isUnset(request.contacterStaffNo)) {
    query['ContacterStaffNo'] = request.contacterStaffNo;
  }
  if (!Util.isUnset(request.contacterType)) {
    query['ContacterType'] = request.contacterType;
  }
  if (!Util.isUnset(request.contacterWangwang)) {
    query['ContacterWangwang'] = request.contacterWangwang;
  }
  if (!Util.isUnset(request.emailConfirmed)) {
    query['EmailConfirmed'] = request.emailConfirmed;
  }
  if (!Util.isUnset(request.mobileConfirmed)) {
    query['MobileConfirmed'] = request.mobileConfirmed;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateContacter',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createContacter(request: CreateContacterRequest): CreateContacterResponse {
  var runtime = new Util.RuntimeOptions{};
  return createContacterWithOptions(request, runtime);
}

model CreateRealNameCertificationRequest {
  accountCertifyType?: string(name='AccountCertifyType'),
  corporateLicenseNumber?: string(name='CorporateLicenseNumber'),
  corporateName?: string(name='CorporateName'),
  licenseNumber?: string(name='LicenseNumber'),
  licenseType?: string(name='LicenseType'),
  name?: string(name='Name'),
  pk?: string(name='Pk'),
}

model CreateRealNameCertificationResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CreateRealNameCertificationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateRealNameCertificationResponseBody(name='body'),
}

async function createRealNameCertificationWithOptions(request: CreateRealNameCertificationRequest, runtime: Util.RuntimeOptions): CreateRealNameCertificationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountCertifyType)) {
    query['AccountCertifyType'] = request.accountCertifyType;
  }
  if (!Util.isUnset(request.corporateLicenseNumber)) {
    query['CorporateLicenseNumber'] = request.corporateLicenseNumber;
  }
  if (!Util.isUnset(request.corporateName)) {
    query['CorporateName'] = request.corporateName;
  }
  if (!Util.isUnset(request.licenseNumber)) {
    query['LicenseNumber'] = request.licenseNumber;
  }
  if (!Util.isUnset(request.licenseType)) {
    query['LicenseType'] = request.licenseType;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateRealNameCertification',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createRealNameCertification(request: CreateRealNameCertificationRequest): CreateRealNameCertificationResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRealNameCertificationWithOptions(request, runtime);
}

model CustomerSensitiveInfoLogicalDeleteRequest {
  uid?: string(name='Uid'),
}

model CustomerSensitiveInfoLogicalDeleteResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CustomerSensitiveInfoLogicalDeleteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CustomerSensitiveInfoLogicalDeleteResponseBody(name='body'),
}

async function customerSensitiveInfoLogicalDeleteWithOptions(request: CustomerSensitiveInfoLogicalDeleteRequest, runtime: Util.RuntimeOptions): CustomerSensitiveInfoLogicalDeleteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CustomerSensitiveInfoLogicalDelete',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function customerSensitiveInfoLogicalDelete(request: CustomerSensitiveInfoLogicalDeleteRequest): CustomerSensitiveInfoLogicalDeleteResponse {
  var runtime = new Util.RuntimeOptions{};
  return customerSensitiveInfoLogicalDeleteWithOptions(request, runtime);
}

model CustomerSensitiveInfoPhysicalDeleteRequest {
  uid?: string(name='Uid'),
}

model CustomerSensitiveInfoPhysicalDeleteResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model CustomerSensitiveInfoPhysicalDeleteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CustomerSensitiveInfoPhysicalDeleteResponseBody(name='body'),
}

async function customerSensitiveInfoPhysicalDeleteWithOptions(request: CustomerSensitiveInfoPhysicalDeleteRequest, runtime: Util.RuntimeOptions): CustomerSensitiveInfoPhysicalDeleteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CustomerSensitiveInfoPhysicalDelete',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function customerSensitiveInfoPhysicalDelete(request: CustomerSensitiveInfoPhysicalDeleteRequest): CustomerSensitiveInfoPhysicalDeleteResponse {
  var runtime = new Util.RuntimeOptions{};
  return customerSensitiveInfoPhysicalDeleteWithOptions(request, runtime);
}

model DeleteContacterRequest {
  contacterId?: long(name='ContacterId'),
  userId?: long(name='UserId'),
}

model DeleteContacterResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteContacterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteContacterResponseBody(name='body'),
}

async function deleteContacterWithOptions(request: DeleteContacterRequest, runtime: Util.RuntimeOptions): DeleteContacterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contacterId)) {
    query['ContacterId'] = request.contacterId;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteContacter',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteContacter(request: DeleteContacterRequest): DeleteContacterResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteContacterWithOptions(request, runtime);
}

model DeleteCustomerLabelRequest {
  labelSeries?: string(name='LabelSeries'),
  labelTypes?: [ string ](name='LabelTypes'),
  organization?: string(name='Organization'),
  PK?: long(name='PK'),
  token?: string(name='Token'),
  userName?: string(name='UserName'),
}

model DeleteCustomerLabelResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  success?: boolean(name='Success'),
}

model DeleteCustomerLabelResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteCustomerLabelResponseBody(name='body'),
}

async function deleteCustomerLabelWithOptions(request: DeleteCustomerLabelRequest, runtime: Util.RuntimeOptions): DeleteCustomerLabelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.labelSeries)) {
    query['LabelSeries'] = request.labelSeries;
  }
  if (!Util.isUnset(request.labelTypes)) {
    query['LabelTypes'] = request.labelTypes;
  }
  if (!Util.isUnset(request.organization)) {
    query['Organization'] = request.organization;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  if (!Util.isUnset(request.userName)) {
    query['UserName'] = request.userName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCustomerLabel',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteCustomerLabel(request: DeleteCustomerLabelRequest): DeleteCustomerLabelResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteCustomerLabelWithOptions(request, runtime);
}

model ExistBindsByOuterIdRequest {
  appName?: string(name='AppName'),
  minorOuterId?: string(name='MinorOuterId'),
  outerId?: string(name='OuterId'),
  tenantId?: string(name='TenantId'),
}

model ExistBindsByOuterIdResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  httpCode?: string(name='HttpCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ExistBindsByOuterIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ExistBindsByOuterIdResponseBody(name='body'),
}

async function existBindsByOuterIdWithOptions(request: ExistBindsByOuterIdRequest, runtime: Util.RuntimeOptions): ExistBindsByOuterIdResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ExistBindsByOuterId',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function existBindsByOuterId(request: ExistBindsByOuterIdRequest): ExistBindsByOuterIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return existBindsByOuterIdWithOptions(request, runtime);
}

model FindAllContacterRequest {
  localeString?: string(name='LocaleString'),
  type?: string(name='Type'),
  userId?: long(name='UserId'),
}

model FindAllContacterResponseBody = {
  code?: string(name='Code'),
  data?: {
    contacterInfo?: [ 
    {
      contacterAddress?: string(name='ContacterAddress'),
      contacterDingding?: string(name='ContacterDingding'),
      contacterEmail?: string(name='ContacterEmail'),
      contacterId?: long(name='ContacterId'),
      contacterMobile?: string(name='ContacterMobile'),
      contacterName?: string(name='ContacterName'),
      contacterPosition?: string(name='ContacterPosition'),
      contacterStaffNo?: string(name='ContacterStaffNo'),
      contacterType?: string(name='ContacterType'),
      contacterWangwang?: string(name='ContacterWangwang'),
      emailConfirmed?: boolean(name='EmailConfirmed'),
      mobileConfirmed?: boolean(name='MobileConfirmed'),
    }
  ](name='ContacterInfo')
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FindAllContacterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: FindAllContacterResponseBody(name='body'),
}

async function findAllContacterWithOptions(request: FindAllContacterRequest, runtime: Util.RuntimeOptions): FindAllContacterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.localeString)) {
    query['LocaleString'] = request.localeString;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FindAllContacter',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function findAllContacter(request: FindAllContacterRequest): FindAllContacterResponse {
  var runtime = new Util.RuntimeOptions{};
  return findAllContacterWithOptions(request, runtime);
}

model FindBizCategoryConfigRequest {
  localeString?: string(name='LocaleString'),
  userId?: long(name='UserId'),
}

model FindBizCategoryConfigResponseBody = {
  code?: string(name='Code'),
  data?: {
    bizCategory?: [ 
    {
      code?: string(name='Code'),
      isCheck?: boolean(name='IsCheck'),
      mainBiz?: boolean(name='MainBiz'),
      name?: string(name='Name'),
      other?: string(name='Other'),
      subConfigs?: {
        bizSubCategory?: [ 
        {
          code?: string(name='Code'),
          isCheck?: boolean(name='IsCheck'),
          mainBiz?: boolean(name='MainBiz'),
          name?: string(name='Name'),
          other?: string(name='Other'),
        }
      ](name='BizSubCategory')
      }(name='SubConfigs'),
    }
  ](name='BizCategory')
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FindBizCategoryConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: FindBizCategoryConfigResponseBody(name='body'),
}

async function findBizCategoryConfigWithOptions(request: FindBizCategoryConfigRequest, runtime: Util.RuntimeOptions): FindBizCategoryConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.localeString)) {
    query['LocaleString'] = request.localeString;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FindBizCategoryConfig',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function findBizCategoryConfig(request: FindBizCategoryConfigRequest): FindBizCategoryConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return findBizCategoryConfigWithOptions(request, runtime);
}

model FindContacterRequest {
  contacterId?: long(name='ContacterId'),
  localeString?: string(name='LocaleString'),
  type?: string(name='Type'),
}

model FindContacterResponseBody = {
  code?: string(name='Code'),
  data?: {
    contacterAddress?: string(name='ContacterAddress'),
    contacterDingding?: string(name='ContacterDingding'),
    contacterEmail?: string(name='ContacterEmail'),
    contacterId?: long(name='ContacterId'),
    contacterMobile?: string(name='ContacterMobile'),
    contacterName?: string(name='ContacterName'),
    contacterPosition?: string(name='ContacterPosition'),
    contacterStaffNo?: string(name='ContacterStaffNo'),
    contacterType?: string(name='ContacterType'),
    contacterWangwang?: string(name='ContacterWangwang'),
    emailConfirmed?: boolean(name='EmailConfirmed'),
    mobileConfirmed?: boolean(name='MobileConfirmed'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FindContacterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: FindContacterResponseBody(name='body'),
}

async function findContacterWithOptions(request: FindContacterRequest, runtime: Util.RuntimeOptions): FindContacterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contacterId)) {
    query['ContacterId'] = request.contacterId;
  }
  if (!Util.isUnset(request.localeString)) {
    query['LocaleString'] = request.localeString;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FindContacter',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function findContacter(request: FindContacterRequest): FindContacterResponse {
  var runtime = new Util.RuntimeOptions{};
  return findContacterWithOptions(request, runtime);
}

model FindCustomerInfoRequest {
  userId?: long(name='UserId'),
}

model FindCustomerInfoResponseBody = {
  code?: string(name='Code'),
  data?: {
    biz?: string(name='Biz'),
    website?: string(name='Website'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FindCustomerInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: FindCustomerInfoResponseBody(name='body'),
}

async function findCustomerInfoWithOptions(request: FindCustomerInfoRequest, runtime: Util.RuntimeOptions): FindCustomerInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FindCustomerInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function findCustomerInfo(request: FindCustomerInfoRequest): FindCustomerInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return findCustomerInfoWithOptions(request, runtime);
}

model FindCustomerSnapshotRequest {
  infoType?: string(name='InfoType'),
  pk?: long(name='Pk'),
  versionId?: string(name='VersionId'),
}

model FindCustomerSnapshotResponseBody = {
  code?: string(name='Code'),
  customerSnapshot?: {
    accountInfoSnapshotModel?: {
      address?: string(name='Address'),
      address2?: string(name='Address2'),
      address3?: string(name='Address3'),
      address4?: string(name='Address4'),
      address5?: string(name='Address5'),
      address6?: string(name='Address6'),
      cityId?: string(name='CityId'),
      cityName?: string(name='CityName'),
      postCode?: string(name='PostCode'),
      provinceId?: string(name='ProvinceId'),
      provinceName?: string(name='ProvinceName'),
      trueName?: string(name='TrueName'),
    }(name='AccountInfoSnapshotModel'),
    accountTaxSnapshotModel?: {
      financeTaxCertificateImgName?: string(name='FinanceTaxCertificateImgName'),
      financeTaxCertificateImgUrl?: string(name='FinanceTaxCertificateImgUrl'),
      secondFinanceTax?: string(name='SecondFinanceTax'),
      secondFinanceTaxCertificateImgName?: string(name='SecondFinanceTaxCertificateImgName'),
      secondFinanceTaxCertificateImgUrl?: string(name='SecondFinanceTaxCertificateImgUrl'),
      tax?: string(name='Tax'),
    }(name='AccountTaxSnapshotModel'),
    gmtCreate?: string(name='GmtCreate'),
    id?: long(name='Id'),
    infoType?: string(name='InfoType'),
    kpId?: long(name='KpId'),
  }(name='CustomerSnapshot'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FindCustomerSnapshotResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: FindCustomerSnapshotResponseBody(name='body'),
}

async function findCustomerSnapshotWithOptions(request: FindCustomerSnapshotRequest, runtime: Util.RuntimeOptions): FindCustomerSnapshotResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.infoType)) {
    query['InfoType'] = request.infoType;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  if (!Util.isUnset(request.versionId)) {
    query['VersionId'] = request.versionId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FindCustomerSnapshot',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function findCustomerSnapshot(request: FindCustomerSnapshotRequest): FindCustomerSnapshotResponse {
  var runtime = new Util.RuntimeOptions{};
  return findCustomerSnapshotWithOptions(request, runtime);
}

model FindFinanceTaxRequest {
  HId?: long(name='HId'),
  taxVersion?: string(name='TaxVersion'),
}

model FindFinanceTaxResponseBody = {
  code?: string(name='Code'),
  financeVersion?: {
    financeTaxCertificateImgName?: string(name='FinanceTaxCertificateImgName'),
    financeTaxCertificateImgUrl?: string(name='FinanceTaxCertificateImgUrl'),
    secondFinanceTax?: string(name='SecondFinanceTax'),
    secondFinanceTaxCertificateImgName?: string(name='SecondFinanceTaxCertificateImgName'),
    secondFinanceTaxCertificateImgUrl?: string(name='SecondFinanceTaxCertificateImgUrl'),
    tax?: string(name='Tax'),
    version?: string(name='Version'),
  }(name='FinanceVersion'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FindFinanceTaxResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: FindFinanceTaxResponseBody(name='body'),
}

async function findFinanceTaxWithOptions(request: FindFinanceTaxRequest, runtime: Util.RuntimeOptions): FindFinanceTaxResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.HId)) {
    query['HId'] = request.HId;
  }
  if (!Util.isUnset(request.taxVersion)) {
    query['TaxVersion'] = request.taxVersion;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FindFinanceTax',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function findFinanceTax(request: FindFinanceTaxRequest): FindFinanceTaxResponse {
  var runtime = new Util.RuntimeOptions{};
  return findFinanceTaxWithOptions(request, runtime);
}

model FindFinanceTaxDetailRequest {
  kpId?: long(name='KpId'),
}

model FindFinanceTaxDetailResponseBody = {
  code?: string(name='Code'),
  finance?: {
    financeTaxCertificateImgName?: string(name='FinanceTaxCertificateImgName'),
    tax?: string(name='Tax'),
    financeTaxCertificateImgUrl?: string(name='financeTaxCertificateImgUrl'),
    secondFinanceTax?: string(name='secondFinanceTax'),
    secondFinanceTaxCertificateImgName?: string(name='secondFinanceTaxCertificateImgName'),
    secondFinanceTaxCertificateImgUrl?: string(name='secondFinanceTaxCertificateImgUrl'),
  }(name='Finance'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model FindFinanceTaxDetailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: FindFinanceTaxDetailResponseBody(name='body'),
}

async function findFinanceTaxDetailWithOptions(request: FindFinanceTaxDetailRequest, runtime: Util.RuntimeOptions): FindFinanceTaxDetailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.kpId)) {
    query['KpId'] = request.kpId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FindFinanceTaxDetail',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function findFinanceTaxDetail(request: FindFinanceTaxDetailRequest): FindFinanceTaxDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  return findFinanceTaxDetailWithOptions(request, runtime);
}

model ForbiddenAgAccountLoginRequest {
  agAccountType?: string(name='AgAccountType'),
  appName?: string(name='AppName'),
  mpk?: string(name='Mpk'),
  pk?: string(name='Pk'),
}

model ForbiddenAgAccountLoginResponseBody = {
  code?: string(name='Code'),
  data?: boolean(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ForbiddenAgAccountLoginResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ForbiddenAgAccountLoginResponseBody(name='body'),
}

async function forbiddenAgAccountLoginWithOptions(request: ForbiddenAgAccountLoginRequest, runtime: Util.RuntimeOptions): ForbiddenAgAccountLoginResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agAccountType)) {
    query['AgAccountType'] = request.agAccountType;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ForbiddenAgAccountLogin',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function forbiddenAgAccountLogin(request: ForbiddenAgAccountLoginRequest): ForbiddenAgAccountLoginResponse {
  var runtime = new Util.RuntimeOptions{};
  return forbiddenAgAccountLoginWithOptions(request, runtime);
}

model GetAgAccountAkRequest {
  agAccountType?: string(name='AgAccountType'),
  mpk?: string(name='Mpk'),
  pk?: string(name='Pk'),
}

model GetAgAccountAkResponseBody = {
  accountAkDto?: {
    ak?: string(name='Ak'),
    secret?: string(name='Secret'),
  }(name='AccountAkDto'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
}

model GetAgAccountAkResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAgAccountAkResponseBody(name='body'),
}

async function getAgAccountAkWithOptions(request: GetAgAccountAkRequest, runtime: Util.RuntimeOptions): GetAgAccountAkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agAccountType)) {
    query['AgAccountType'] = request.agAccountType;
  }
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAgAccountAk',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAgAccountAk(request: GetAgAccountAkRequest): GetAgAccountAkResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgAccountAkWithOptions(request, runtime);
}

model GetAgRelationRequest {
  agAccountType?: string(name='AgAccountType'),
  pk?: string(name='Pk'),
}

model GetAgRelationResponseBody = {
  agRelationDto?: {
    mpk?: string(name='Mpk'),
    pk?: string(name='Pk'),
    type?: string(name='Type'),
  }(name='AgRelationDto'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetAgRelationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAgRelationResponseBody(name='body'),
}

async function getAgRelationWithOptions(request: GetAgRelationRequest, runtime: Util.RuntimeOptions): GetAgRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agAccountType)) {
    query['AgAccountType'] = request.agAccountType;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAgRelation',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAgRelation(request: GetAgRelationRequest): GetAgRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAgRelationWithOptions(request, runtime);
}

model GetAliyunIdByPkRequest {
  appName?: string(name='AppName'),
  pk?: string(name='Pk'),
}

model GetAliyunIdByPkResponseBody = {
  aliyunId?: string(name='AliyunId'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetAliyunIdByPkResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAliyunIdByPkResponseBody(name='body'),
}

async function getAliyunIdByPkWithOptions(request: GetAliyunIdByPkRequest, runtime: Util.RuntimeOptions): GetAliyunIdByPkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAliyunIdByPk',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAliyunIdByPk(request: GetAliyunIdByPkRequest): GetAliyunIdByPkResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAliyunIdByPkWithOptions(request, runtime);
}

model GetAliyunPKByAliyunIDRequest {
  aliyunId?: string(name='AliyunId'),
  email?: string(name='Email'),
  havanaId?: string(name='HavanaId'),
  mobile?: string(name='Mobile'),
  PK?: string(name='PK'),
}

model GetAliyunPKByAliyunIDResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
}

model GetAliyunPKByAliyunIDResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAliyunPKByAliyunIDResponseBody(name='body'),
}

async function getAliyunPKByAliyunIDWithOptions(request: GetAliyunPKByAliyunIDRequest, runtime: Util.RuntimeOptions): GetAliyunPKByAliyunIDResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliyunId)) {
    query['AliyunId'] = request.aliyunId;
  }
  if (!Util.isUnset(request.email)) {
    query['Email'] = request.email;
  }
  if (!Util.isUnset(request.havanaId)) {
    query['HavanaId'] = request.havanaId;
  }
  if (!Util.isUnset(request.mobile)) {
    query['Mobile'] = request.mobile;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAliyunPKByAliyunID',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAliyunPKByAliyunID(request: GetAliyunPKByAliyunIDRequest): GetAliyunPKByAliyunIDResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAliyunPKByAliyunIDWithOptions(request, runtime);
}

model GetCustomerCategoryRequest {
  localeString?: string(name='LocaleString'),
  userId?: long(name='UserId'),
}

model GetCustomerCategoryResponseBody = {
  code?: string(name='Code'),
  data?: {
    bizCategory?: [ 
    {
      code?: string(name='Code'),
      isCheck?: boolean(name='IsCheck'),
      mainBiz?: boolean(name='MainBiz'),
      name?: string(name='Name'),
      other?: string(name='Other'),
      subConfigs?: {
        bizSubCategory?: [ 
        {
          code?: string(name='Code'),
          isCheck?: boolean(name='IsCheck'),
          mainBiz?: boolean(name='MainBiz'),
          name?: string(name='Name'),
          other?: string(name='Other'),
        }
      ](name='BizSubCategory')
      }(name='SubConfigs'),
    }
  ](name='BizCategory')
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetCustomerCategoryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCustomerCategoryResponseBody(name='body'),
}

async function getCustomerCategoryWithOptions(request: GetCustomerCategoryRequest, runtime: Util.RuntimeOptions): GetCustomerCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.localeString)) {
    query['LocaleString'] = request.localeString;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCustomerCategory',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCustomerCategory(request: GetCustomerCategoryRequest): GetCustomerCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCustomerCategoryWithOptions(request, runtime);
}

model GetCustomerCategoryDictionaryRequest {
  type?: string(name='Type'),
}

model GetCustomerCategoryDictionaryResponseBody = {
  code?: string(name='Code'),
  data?: {
    enumConfig?: [ 
    {
      enumName?: string(name='enumName'),
      enumValue?: string(name='enumValue'),
    }
  ](name='EnumConfig')
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetCustomerCategoryDictionaryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCustomerCategoryDictionaryResponseBody(name='body'),
}

async function getCustomerCategoryDictionaryWithOptions(request: GetCustomerCategoryDictionaryRequest, runtime: Util.RuntimeOptions): GetCustomerCategoryDictionaryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCustomerCategoryDictionary',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCustomerCategoryDictionary(request: GetCustomerCategoryDictionaryRequest): GetCustomerCategoryDictionaryResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCustomerCategoryDictionaryWithOptions(request, runtime);
}

model GetCustomerInformationRequest {
  userId?: long(name='UserId'),
}

model GetCustomerInformationResponseBody = {
  code?: string(name='Code'),
  data?: {
    biz?: string(name='Biz'),
    website?: string(name='Website'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetCustomerInformationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCustomerInformationResponseBody(name='body'),
}

async function getCustomerInformationWithOptions(request: GetCustomerInformationRequest, runtime: Util.RuntimeOptions): GetCustomerInformationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetCustomerInformation',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCustomerInformation(request: GetCustomerInformationRequest): GetCustomerInformationResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCustomerInformationWithOptions(request, runtime);
}

model GetDingTalkUserOrgByAliyunTmpCodeRequest {
  appName?: string(name='AppName'),
  dingTalkChannel?: string(name='DingTalkChannel'),
  tmpCode?: string(name='TmpCode'),
  version?: string(name='Version'),
}

model GetDingTalkUserOrgByAliyunTmpCodeResponseBody = {
  code?: string(name='Code'),
  data?: {
    associatedUnionId?: string(name='AssociatedUnionId'),
    nick?: string(name='Nick'),
    orgDtoList?: [ 
      {
        corpId?: string(name='CorpId'),
        orgId?: string(name='OrgId'),
        orgName?: string(name='OrgName'),
      }
    ](name='OrgDtoList'),
  }(name='Data'),
  httpCode?: string(name='HttpCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetDingTalkUserOrgByAliyunTmpCodeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetDingTalkUserOrgByAliyunTmpCodeResponseBody(name='body'),
}

async function getDingTalkUserOrgByAliyunTmpCodeWithOptions(request: GetDingTalkUserOrgByAliyunTmpCodeRequest, runtime: Util.RuntimeOptions): GetDingTalkUserOrgByAliyunTmpCodeResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDingTalkUserOrgByAliyunTmpCode',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getDingTalkUserOrgByAliyunTmpCode(request: GetDingTalkUserOrgByAliyunTmpCodeRequest): GetDingTalkUserOrgByAliyunTmpCodeResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDingTalkUserOrgByAliyunTmpCodeWithOptions(request, runtime);
}

model GetIdentityRegistrationByCustomerRequest {
  customerId?: string(name='CustomerId'),
}

model GetIdentityRegistrationByCustomerResponseBody = {
  code?: string(name='Code'),
  data?: {
    accountType?: int32(name='AccountType'),
    applicationId?: long(name='ApplicationId'),
    applyStatus?: string(name='ApplyStatus'),
    auditCode?: string(name='AuditCode'),
    customerId?: long(name='CustomerId'),
    docBackPic?: string(name='DocBackPic'),
    docFrontPic?: string(name='DocFrontPic'),
    docNum?: string(name='DocNum'),
    docType?: string(name='DocType'),
    email?: string(name='Email'),
    fullName?: string(name='FullName'),
    registeredAddress?: string(name='RegisteredAddress'),
    registeredCountry?: string(name='RegisteredCountry'),
    registeredNum?: string(name='RegisteredNum'),
    tel?: string(name='Tel'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetIdentityRegistrationByCustomerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetIdentityRegistrationByCustomerResponseBody(name='body'),
}

async function getIdentityRegistrationByCustomerWithOptions(request: GetIdentityRegistrationByCustomerRequest, runtime: Util.RuntimeOptions): GetIdentityRegistrationByCustomerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.customerId)) {
    query['CustomerId'] = request.customerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetIdentityRegistrationByCustomer',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getIdentityRegistrationByCustomer(request: GetIdentityRegistrationByCustomerRequest): GetIdentityRegistrationByCustomerResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIdentityRegistrationByCustomerWithOptions(request, runtime);
}

model GetProfileTypeByPkRequest {
  appName?: string(name='AppName'),
  pk?: string(name='Pk'),
}

model GetProfileTypeByPkResponseBody = {
  accountType?: string(name='AccountType'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetProfileTypeByPkResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetProfileTypeByPkResponseBody(name='body'),
}

async function getProfileTypeByPkWithOptions(request: GetProfileTypeByPkRequest, runtime: Util.RuntimeOptions): GetProfileTypeByPkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetProfileTypeByPk',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getProfileTypeByPk(request: GetProfileTypeByPkRequest): GetProfileTypeByPkResponse {
  var runtime = new Util.RuntimeOptions{};
  return getProfileTypeByPkWithOptions(request, runtime);
}

model GetUploadIdentityRegistrationDocConfigRequest {
  customerId?: string(name='CustomerId'),
  filePath?: string(name='FilePath'),
}

model GetUploadIdentityRegistrationDocConfigResponseBody = {
  code?: string(name='Code'),
  data?: {
    bucketName?: string(name='BucketName'),
    fileName?: string(name='fileName'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model GetUploadIdentityRegistrationDocConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetUploadIdentityRegistrationDocConfigResponseBody(name='body'),
}

async function getUploadIdentityRegistrationDocConfigWithOptions(request: GetUploadIdentityRegistrationDocConfigRequest, runtime: Util.RuntimeOptions): GetUploadIdentityRegistrationDocConfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.customerId)) {
    query['CustomerId'] = request.customerId;
  }
  if (!Util.isUnset(request.filePath)) {
    query['FilePath'] = request.filePath;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUploadIdentityRegistrationDocConfig',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUploadIdentityRegistrationDocConfig(request: GetUploadIdentityRegistrationDocConfigRequest): GetUploadIdentityRegistrationDocConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUploadIdentityRegistrationDocConfigWithOptions(request, runtime);
}

model LoadRealNameInfoByPkRequest {
  PK?: string(name='PK'),
}

model LoadRealNameInfoByPkResponseBody = {
  code?: string(name='Code'),
  data?: {
    accountCertifyType?: string(name='AccountCertifyType'),
    authAlipay?: string(name='AuthAlipay'),
    authAlipayDomain?: string(name='AuthAlipayDomain'),
    authAlipayLoginId?: string(name='AuthAlipayLoginId'),
    authBeiAnCid?: string(name='AuthBeiAnCid'),
    authDomain?: string(name='AuthDomain'),
    certifiedFrom?: string(name='CertifiedFrom'),
    certifiedTime?: string(name='CertifiedTime'),
    certifyStatus?: int32(name='CertifyStatus'),
    cicCertifyFrom?: int32(name='CicCertifyFrom'),
    cicCertifyProduct?: long(name='CicCertifyProduct'),
    isBankIDAuth?: boolean(name='IsBankIDAuth'),
    isCertified?: boolean(name='IsCertified'),
    licenseNumber?: string(name='LicenseNumber'),
    licenseType?: string(name='LicenseType'),
    name?: string(name='Name'),
    newUnityRealNameAccount?: string(name='NewUnityRealNameAccount'),
    processingEnterpriseCertify?: boolean(name='ProcessingEnterpriseCertify'),
  }(name='Data'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
}

model LoadRealNameInfoByPkResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: LoadRealNameInfoByPkResponseBody(name='body'),
}

async function loadRealNameInfoByPkWithOptions(request: LoadRealNameInfoByPkRequest, runtime: Util.RuntimeOptions): LoadRealNameInfoByPkResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'LoadRealNameInfoByPk',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function loadRealNameInfoByPk(request: LoadRealNameInfoByPkRequest): LoadRealNameInfoByPkResponse {
  var runtime = new Util.RuntimeOptions{};
  return loadRealNameInfoByPkWithOptions(request, runtime);
}

model MapFromHavanaBindIdRequest {
  appName?: string(name='AppName'),
  havanaBindId?: string(name='HavanaBindId'),
  havanaBindStations?: map[string]any(name='HavanaBindStations'),
}

model MapFromHavanaBindIdShrinkRequest {
  appName?: string(name='AppName'),
  havanaBindId?: string(name='HavanaBindId'),
  havanaBindStationsShrink?: string(name='HavanaBindStations'),
}

model MapFromHavanaBindIdResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      bindHid?: string(name='BindHid'),
      havanaBindId?: string(name='HavanaBindId'),
      havanaBindStation?: string(name='HavanaBindStation'),
      pk?: string(name='Pk'),
    }
  ](name='Data'),
  httpCode?: string(name='HttpCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model MapFromHavanaBindIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MapFromHavanaBindIdResponseBody(name='body'),
}

async function mapFromHavanaBindIdWithOptions(tmpReq: MapFromHavanaBindIdRequest, runtime: Util.RuntimeOptions): MapFromHavanaBindIdResponse {
  Util.validateModel(tmpReq);
  var request = new MapFromHavanaBindIdShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.havanaBindStations)) {
    request.havanaBindStationsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.havanaBindStations, 'HavanaBindStations', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.havanaBindId)) {
    query['HavanaBindId'] = request.havanaBindId;
  }
  if (!Util.isUnset(request.havanaBindStationsShrink)) {
    query['HavanaBindStations'] = request.havanaBindStationsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MapFromHavanaBindId',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function mapFromHavanaBindId(request: MapFromHavanaBindIdRequest): MapFromHavanaBindIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return mapFromHavanaBindIdWithOptions(request, runtime);
}

model MapPkFromHidRequest {
  appName?: string(name='AppName'),
  bid?: string(name='Bid'),
  hid?: string(name='Hid'),
  mappingScenes?: string(name='MappingScenes'),
}

model MapPkFromHidResponseBody = {
  code?: string(name='Code'),
  data?: {
    hid?: string(name='Hid'),
    mappingSrc?: string(name='MappingSrc'),
    pk?: string(name='Pk'),
  }(name='Data'),
  httpCode?: string(name='HttpCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model MapPkFromHidResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MapPkFromHidResponseBody(name='body'),
}

async function mapPkFromHidWithOptions(request: MapPkFromHidRequest, runtime: Util.RuntimeOptions): MapPkFromHidResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.bid)) {
    query['Bid'] = request.bid;
  }
  if (!Util.isUnset(request.hid)) {
    query['Hid'] = request.hid;
  }
  if (!Util.isUnset(request.mappingScenes)) {
    query['MappingScenes'] = request.mappingScenes;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MapPkFromHid',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function mapPkFromHid(request: MapPkFromHidRequest): MapPkFromHidResponse {
  var runtime = new Util.RuntimeOptions{};
  return mapPkFromHidWithOptions(request, runtime);
}

model MapPkToHidRequest {
  appName?: string(name='AppName'),
  mappingScenes?: string(name='MappingScenes'),
  pk?: string(name='Pk'),
}

model MapPkToHidResponseBody = {
  code?: string(name='Code'),
  data?: {
    hid?: string(name='Hid'),
    mappingSrc?: string(name='MappingSrc'),
    pk?: string(name='Pk'),
  }(name='Data'),
  httpCode?: string(name='HttpCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model MapPkToHidResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MapPkToHidResponseBody(name='body'),
}

async function mapPkToHidWithOptions(request: MapPkToHidRequest, runtime: Util.RuntimeOptions): MapPkToHidResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.mappingScenes)) {
    query['MappingScenes'] = request.mappingScenes;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MapPkToHid',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function mapPkToHid(request: MapPkToHidRequest): MapPkToHidResponse {
  var runtime = new Util.RuntimeOptions{};
  return mapPkToHidWithOptions(request, runtime);
}

model MapToHavanaBindIdRequest {
  appName?: string(name='AppName'),
  havanaBindStations?: map[string]any(name='HavanaBindStations'),
  pk?: string(name='Pk'),
}

model MapToHavanaBindIdShrinkRequest {
  appName?: string(name='AppName'),
  havanaBindStationsShrink?: string(name='HavanaBindStations'),
  pk?: string(name='Pk'),
}

model MapToHavanaBindIdResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      bindHid?: string(name='BindHid'),
      havanaBindId?: string(name='HavanaBindId'),
      havanaBindStation?: string(name='HavanaBindStation'),
      pk?: string(name='Pk'),
    }
  ](name='Data'),
  httpCode?: string(name='HttpCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model MapToHavanaBindIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MapToHavanaBindIdResponseBody(name='body'),
}

async function mapToHavanaBindIdWithOptions(tmpReq: MapToHavanaBindIdRequest, runtime: Util.RuntimeOptions): MapToHavanaBindIdResponse {
  Util.validateModel(tmpReq);
  var request = new MapToHavanaBindIdShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.havanaBindStations)) {
    request.havanaBindStationsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.havanaBindStations, 'HavanaBindStations', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.havanaBindStationsShrink)) {
    query['HavanaBindStations'] = request.havanaBindStationsShrink;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'MapToHavanaBindId',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function mapToHavanaBindId(request: MapToHavanaBindIdRequest): MapToHavanaBindIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return mapToHavanaBindIdWithOptions(request, runtime);
}

model ModifyBizCategoryRequest {
  paramList?: string(name='ParamList'),
  userId?: long(name='UserId'),
}

model ModifyBizCategoryResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyBizCategoryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyBizCategoryResponseBody(name='body'),
}

async function modifyBizCategoryWithOptions(request: ModifyBizCategoryRequest, runtime: Util.RuntimeOptions): ModifyBizCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.paramList)) {
    query['ParamList'] = request.paramList;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyBizCategory',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyBizCategory(request: ModifyBizCategoryRequest): ModifyBizCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyBizCategoryWithOptions(request, runtime);
}

model ModifyContacterRequest {
  contacterAddress?: string(name='ContacterAddress'),
  contacterDingding?: string(name='ContacterDingding'),
  contacterEmail?: string(name='ContacterEmail'),
  contacterId?: long(name='ContacterId'),
  contacterMobile?: string(name='ContacterMobile'),
  contacterName?: string(name='ContacterName'),
  contacterPosition?: string(name='ContacterPosition'),
  contacterStaffNo?: string(name='ContacterStaffNo'),
  contacterType?: string(name='ContacterType'),
  contacterWangwang?: string(name='ContacterWangwang'),
  emailConfirmed?: boolean(name='EmailConfirmed'),
  mobileConfirmed?: boolean(name='MobileConfirmed'),
  userId?: long(name='UserId'),
}

model ModifyContacterResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyContacterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyContacterResponseBody(name='body'),
}

async function modifyContacterWithOptions(request: ModifyContacterRequest, runtime: Util.RuntimeOptions): ModifyContacterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.contacterAddress)) {
    query['ContacterAddress'] = request.contacterAddress;
  }
  if (!Util.isUnset(request.contacterDingding)) {
    query['ContacterDingding'] = request.contacterDingding;
  }
  if (!Util.isUnset(request.contacterEmail)) {
    query['ContacterEmail'] = request.contacterEmail;
  }
  if (!Util.isUnset(request.contacterId)) {
    query['ContacterId'] = request.contacterId;
  }
  if (!Util.isUnset(request.contacterMobile)) {
    query['ContacterMobile'] = request.contacterMobile;
  }
  if (!Util.isUnset(request.contacterName)) {
    query['ContacterName'] = request.contacterName;
  }
  if (!Util.isUnset(request.contacterPosition)) {
    query['ContacterPosition'] = request.contacterPosition;
  }
  if (!Util.isUnset(request.contacterStaffNo)) {
    query['ContacterStaffNo'] = request.contacterStaffNo;
  }
  if (!Util.isUnset(request.contacterType)) {
    query['ContacterType'] = request.contacterType;
  }
  if (!Util.isUnset(request.contacterWangwang)) {
    query['ContacterWangwang'] = request.contacterWangwang;
  }
  if (!Util.isUnset(request.emailConfirmed)) {
    query['EmailConfirmed'] = request.emailConfirmed;
  }
  if (!Util.isUnset(request.mobileConfirmed)) {
    query['MobileConfirmed'] = request.mobileConfirmed;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyContacter',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyContacter(request: ModifyContacterRequest): ModifyContacterResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyContacterWithOptions(request, runtime);
}

model ModifyCustomerInfoRequest {
  biz?: string(name='Biz'),
  customerCategory?: string(name='CustomerCategory'),
  customerSubCategory?: string(name='CustomerSubCategory'),
  userId?: long(name='UserId'),
  website?: string(name='Website'),
}

model ModifyCustomerInfoResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ModifyCustomerInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyCustomerInfoResponseBody(name='body'),
}

async function modifyCustomerInfoWithOptions(request: ModifyCustomerInfoRequest, runtime: Util.RuntimeOptions): ModifyCustomerInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.biz)) {
    query['Biz'] = request.biz;
  }
  if (!Util.isUnset(request.customerCategory)) {
    query['CustomerCategory'] = request.customerCategory;
  }
  if (!Util.isUnset(request.customerSubCategory)) {
    query['CustomerSubCategory'] = request.customerSubCategory;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!Util.isUnset(request.website)) {
    query['Website'] = request.website;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyCustomerInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyCustomerInfo(request: ModifyCustomerInfoRequest): ModifyCustomerInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyCustomerInfoWithOptions(request, runtime);
}

model OperateFinanceTaxRequest {
  financeTax?: string(name='FinanceTax'),
  financeTaxCertificateImgName?: string(name='FinanceTaxCertificateImgName'),
  HId?: long(name='HId'),
  secondFinanceTax?: string(name='SecondFinanceTax'),
  secondFinanceTaxCertificateImgName?: string(name='SecondFinanceTaxCertificateImgName'),
  secondFinanceTaxCertificateImgUrl?: string(name='SecondFinanceTaxCertificateImgUrl'),
  financeTaxCertificateImgUrl?: string(name='financeTaxCertificateImgUrl'),
}

model OperateFinanceTaxResponseBody = {
  code?: string(name='Code'),
  data?: string(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model OperateFinanceTaxResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: OperateFinanceTaxResponseBody(name='body'),
}

async function operateFinanceTaxWithOptions(request: OperateFinanceTaxRequest, runtime: Util.RuntimeOptions): OperateFinanceTaxResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.financeTax)) {
    query['FinanceTax'] = request.financeTax;
  }
  if (!Util.isUnset(request.financeTaxCertificateImgName)) {
    query['FinanceTaxCertificateImgName'] = request.financeTaxCertificateImgName;
  }
  if (!Util.isUnset(request.HId)) {
    query['HId'] = request.HId;
  }
  if (!Util.isUnset(request.secondFinanceTax)) {
    query['SecondFinanceTax'] = request.secondFinanceTax;
  }
  if (!Util.isUnset(request.secondFinanceTaxCertificateImgName)) {
    query['SecondFinanceTaxCertificateImgName'] = request.secondFinanceTaxCertificateImgName;
  }
  if (!Util.isUnset(request.secondFinanceTaxCertificateImgUrl)) {
    query['SecondFinanceTaxCertificateImgUrl'] = request.secondFinanceTaxCertificateImgUrl;
  }
  if (!Util.isUnset(request.financeTaxCertificateImgUrl)) {
    query['financeTaxCertificateImgUrl'] = request.financeTaxCertificateImgUrl;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OperateFinanceTax',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function operateFinanceTax(request: OperateFinanceTaxRequest): OperateFinanceTaxResponse {
  var runtime = new Util.RuntimeOptions{};
  return operateFinanceTaxWithOptions(request, runtime);
}

model QueryAccountAddressInfoRequest {
  addressVersion?: string(name='AddressVersion'),
  havanaId?: string(name='HavanaId'),
  PK?: string(name='PK'),
}

model QueryAccountAddressInfoResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  profileInfo?: {
    accountAttr?: string(name='AccountAttr'),
    address?: string(name='Address'),
    address2?: string(name='Address2'),
    address3?: string(name='Address3'),
    address4?: string(name='Address4'),
    address5?: string(name='Address5'),
    address6?: string(name='Address6'),
    city?: {
      id?: string(name='Id'),
      name?: string(name='Name'),
    }(name='City'),
    email?: string(name='Email'),
    havanaId?: string(name='HavanaId'),
    nationalityCode?: string(name='NationalityCode'),
    postCode?: string(name='PostCode'),
    province?: {
      id?: string(name='Id'),
      name?: string(name='Name'),
    }(name='Province'),
    trueName?: string(name='TrueName'),
    version?: string(name='Version'),
  }(name='ProfileInfo'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryAccountAddressInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryAccountAddressInfoResponseBody(name='body'),
}

async function queryAccountAddressInfoWithOptions(request: QueryAccountAddressInfoRequest, runtime: Util.RuntimeOptions): QueryAccountAddressInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.addressVersion)) {
    query['AddressVersion'] = request.addressVersion;
  }
  if (!Util.isUnset(request.havanaId)) {
    query['HavanaId'] = request.havanaId;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAccountAddressInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAccountAddressInfo(request: QueryAccountAddressInfoRequest): QueryAccountAddressInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAccountAddressInfoWithOptions(request, runtime);
}

model QueryAccountAddressInfoWithoutHavanaRequest {
  addressVersion?: string(name='AddressVersion'),
  havanaId?: string(name='HavanaId'),
  PK?: string(name='PK'),
}

model QueryAccountAddressInfoWithoutHavanaResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  profileInfo?: {
    accountAttr?: string(name='AccountAttr'),
    address?: string(name='Address'),
    address2?: string(name='Address2'),
    address3?: string(name='Address3'),
    address4?: string(name='Address4'),
    address5?: string(name='Address5'),
    address6?: string(name='Address6'),
    city?: {
      id?: string(name='Id'),
      name?: string(name='Name'),
    }(name='City'),
    havanaId?: string(name='HavanaId'),
    postCode?: string(name='PostCode'),
    province?: {
      id?: string(name='Id'),
      name?: string(name='Name'),
    }(name='Province'),
    trueName?: string(name='TrueName'),
    version?: string(name='Version'),
  }(name='ProfileInfo'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryAccountAddressInfoWithoutHavanaResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryAccountAddressInfoWithoutHavanaResponseBody(name='body'),
}

async function queryAccountAddressInfoWithoutHavanaWithOptions(request: QueryAccountAddressInfoWithoutHavanaRequest, runtime: Util.RuntimeOptions): QueryAccountAddressInfoWithoutHavanaResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.addressVersion)) {
    query['AddressVersion'] = request.addressVersion;
  }
  if (!Util.isUnset(request.havanaId)) {
    query['HavanaId'] = request.havanaId;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAccountAddressInfoWithoutHavana',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAccountAddressInfoWithoutHavana(request: QueryAccountAddressInfoWithoutHavanaRequest): QueryAccountAddressInfoWithoutHavanaResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAccountAddressInfoWithoutHavanaWithOptions(request, runtime);
}

model QueryAccountDeliveryAddressInfoRequest {
  appName?: string(name='AppName'),
  pk?: string(name='Pk'),
  requestId?: string(name='RequestId'),
}

model QueryAccountDeliveryAddressInfoResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      address?: string(name='Address'),
      areaDivision?: {
        divisionAbbName?: string(name='DivisionAbbName'),
        divisionId?: long(name='DivisionId'),
        divisionLevel?: long(name='DivisionLevel'),
        divisionName?: string(name='DivisionName'),
        divisionTname?: string(name='DivisionTname'),
        newDivisionId?: long(name='NewDivisionId'),
        parentId?: long(name='ParentId'),
        pinyin?: string(name='Pinyin'),
        remark?: string(name='Remark'),
      }(name='AreaDivision'),
      areaId?: string(name='AreaId'),
      cityDivision?: {
        divisionAbbName?: string(name='DivisionAbbName'),
        divisionId?: long(name='DivisionId'),
        divisionLevel?: long(name='DivisionLevel'),
        divisionName?: string(name='DivisionName'),
        divisionTname?: string(name='DivisionTname'),
        newDivisionId?: long(name='NewDivisionId'),
        parentId?: long(name='ParentId'),
        pinyin?: string(name='Pinyin'),
        remark?: string(name='Remark'),
      }(name='CityDivision'),
      cityId?: string(name='CityId'),
      contacts?: string(name='Contacts'),
      defaultAddress?: boolean(name='DefaultAddress'),
      email?: string(name='Email'),
      mobile?: string(name='Mobile'),
      phone?: string(name='Phone'),
      pk?: string(name='Pk'),
      postalcode?: string(name='Postalcode'),
      proviceDivision?: {
        divisionAbbName?: string(name='DivisionAbbName'),
        divisionId?: long(name='DivisionId'),
        divisionLevel?: long(name='DivisionLevel'),
        divisionName?: string(name='DivisionName'),
        divisionTname?: string(name='DivisionTname'),
        newDivisionId?: long(name='NewDivisionId'),
        parentId?: long(name='ParentId'),
        pinyin?: string(name='Pinyin'),
        remark?: string(name='Remark'),
      }(name='ProviceDivision'),
      proviceId?: string(name='ProviceId'),
      townDivision?: {
        divisionAbbName?: string(name='DivisionAbbName'),
        divisionId?: long(name='DivisionId'),
        divisionLevel?: long(name='DivisionLevel'),
        divisionName?: string(name='DivisionName'),
        divisionTname?: string(name='DivisionTname'),
        newDivisionId?: long(name='NewDivisionId'),
        parentId?: long(name='ParentId'),
        pinyin?: string(name='Pinyin'),
        remark?: string(name='Remark'),
      }(name='TownDivision'),
      townId?: string(name='TownId'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='Id of the request'),
  success?: boolean(name='Success'),
}

model QueryAccountDeliveryAddressInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryAccountDeliveryAddressInfoResponseBody(name='body'),
}

async function queryAccountDeliveryAddressInfoWithOptions(request: QueryAccountDeliveryAddressInfoRequest, runtime: Util.RuntimeOptions): QueryAccountDeliveryAddressInfoResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAccountDeliveryAddressInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAccountDeliveryAddressInfo(request: QueryAccountDeliveryAddressInfoRequest): QueryAccountDeliveryAddressInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAccountDeliveryAddressInfoWithOptions(request, runtime);
}

model QueryAccountProfileInfoRequest {
  havanaId?: string(name='HavanaId'),
  PK?: string(name='PK'),
}

model QueryAccountProfileInfoResponseBody = {
  profileInfo?: {
    accountAttr?: string(name='AccountAttr'),
    accountCertifyType?: string(name='AccountCertifyType'),
    activeNotSetMobile?: string(name='ActiveNotSetMobile'),
    address?: string(name='Address'),
    address2?: string(name='Address2'),
    address3?: string(name='Address3'),
    address4?: string(name='Address4'),
    address5?: string(name='Address5'),
    address6?: string(name='Address6'),
    alipayAccount?: string(name='AlipayAccount'),
    alipayUid?: string(name='AlipayUid'),
    aliyunID?: string(name='AliyunID'),
    aliyunPK?: string(name='AliyunPK'),
    authAlipay?: string(name='AuthAlipay'),
    authDomainUserId?: string(name='AuthDomainUserId'),
    b2bhid?: string(name='B2bhid'),
    bankId?: string(name='BankId'),
    bankName?: string(name='BankName'),
    beiAnAuthCId?: string(name='BeiAnAuthCId'),
    beiAnIcpNumber?: string(name='BeiAnIcpNumber'),
    beiAnMobile?: string(name='BeiAnMobile'),
    bindAlipayNo?: string(name='BindAlipayNo'),
    certType?: string(name='CertType'),
    certifiedFrom?: string(name='CertifiedFrom'),
    certifiedTime?: string(name='CertifiedTime'),
    city?: {
      id?: string(name='Id'),
      name?: string(name='Name'),
    }(name='City'),
    contactMethod?: string(name='ContactMethod'),
    createTime?: string(name='CreateTime'),
    eid?: string(name='Eid'),
    email?: string(name='Email'),
    fax?: string(name='Fax'),
    firstName?: string(name='FirstName'),
    fyl?: string(name='Fyl'),
    havanaId?: string(name='HavanaId'),
    head?: string(name='Head'),
    IDNumber?: string(name='IDNumber'),
    isBankIDAuth?: string(name='IsBankIDAuth'),
    isCertified?: string(name='IsCertified'),
    lastName?: string(name='LastName'),
    mobile?: string(name='Mobile'),
    nationalityCode?: string(name='NationalityCode'),
    nickName?: string(name='NickName'),
    own?: string(name='Own'),
    phone?: string(name='Phone'),
    postCode?: string(name='PostCode'),
    preferredLanguage?: string(name='PreferredLanguage'),
    processingEnterpriseCertify?: boolean(name='ProcessingEnterpriseCertify'),
    province?: {
      id?: string(name='Id'),
      name?: string(name='Name'),
    }(name='Province'),
    registerIP?: string(name='RegisterIP'),
    securityMobile?: string(name='SecurityMobile'),
    securityQuestionExists?: boolean(name='SecurityQuestionExists'),
    src?: string(name='Src'),
    taobaoAccount?: string(name='TaobaoAccount'),
    taobaoNickFromHavana?: string(name='TaobaoNickFromHavana'),
    tbhid?: string(name='Tbhid'),
    trueName?: string(name='TrueName'),
    updateTime?: string(name='UpdateTime'),
    yahooEmail?: string(name='YahooEmail'),
  }(name='ProfileInfo'),
  requestId?: string(name='RequestId'),
}

model QueryAccountProfileInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryAccountProfileInfoResponseBody(name='body'),
}

async function queryAccountProfileInfoWithOptions(request: QueryAccountProfileInfoRequest, runtime: Util.RuntimeOptions): QueryAccountProfileInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.havanaId)) {
    query['HavanaId'] = request.havanaId;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAccountProfileInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAccountProfileInfo(request: QueryAccountProfileInfoRequest): QueryAccountProfileInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAccountProfileInfoWithOptions(request, runtime);
}

model QueryAccountRealNameInfoRequest {
  PK?: string(name='PK'),
}

model QueryAccountRealNameInfoResponseBody = {
  profileInfo?: {
    accountCertifyType?: string(name='AccountCertifyType'),
    authAlipay?: string(name='AuthAlipay'),
    authBeiAnCid?: string(name='AuthBeiAnCid'),
    authDomain?: string(name='AuthDomain'),
    certifiedFrom?: string(name='CertifiedFrom'),
    certifiedTime?: string(name='CertifiedTime'),
    isBankIDAuth?: string(name='IsBankIDAuth'),
    isCertified?: string(name='IsCertified'),
    licenseNumber?: string(name='LicenseNumber'),
    licenseType?: string(name='LicenseType'),
    name?: string(name='Name'),
    processingEnterpriseCertify?: boolean(name='ProcessingEnterpriseCertify'),
  }(name='ProfileInfo'),
  requestId?: string(name='RequestId'),
}

model QueryAccountRealNameInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryAccountRealNameInfoResponseBody(name='body'),
}

async function queryAccountRealNameInfoWithOptions(request: QueryAccountRealNameInfoRequest, runtime: Util.RuntimeOptions): QueryAccountRealNameInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAccountRealNameInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAccountRealNameInfo(request: QueryAccountRealNameInfoRequest): QueryAccountRealNameInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAccountRealNameInfoWithOptions(request, runtime);
}

model QueryAccountSiteRequest {
  pk?: string(name='Pk'),
}

model QueryAccountSiteResponseBody = {
  code?: string(name='Code'),
  requestId?: string(name='RequestId'),
  site?: string(name='Site'),
  success?: boolean(name='Success'),
}

model QueryAccountSiteResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryAccountSiteResponseBody(name='body'),
}

async function queryAccountSiteWithOptions(request: QueryAccountSiteRequest, runtime: Util.RuntimeOptions): QueryAccountSiteResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAccountSite',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAccountSite(request: QueryAccountSiteRequest): QueryAccountSiteResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAccountSiteWithOptions(request, runtime);
}

model QueryAgAccountLoginPermissionRequest {
  agAccountType?: string(name='AgAccountType'),
  appName?: string(name='AppName'),
  mpk?: string(name='Mpk'),
  pk?: string(name='Pk'),
}

model QueryAgAccountLoginPermissionResponseBody = {
  code?: string(name='Code'),
  hasLoginPermission?: boolean(name='HasLoginPermission'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryAgAccountLoginPermissionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryAgAccountLoginPermissionResponseBody(name='body'),
}

async function queryAgAccountLoginPermissionWithOptions(request: QueryAgAccountLoginPermissionRequest, runtime: Util.RuntimeOptions): QueryAgAccountLoginPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agAccountType)) {
    query['AgAccountType'] = request.agAccountType;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAgAccountLoginPermission',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAgAccountLoginPermission(request: QueryAgAccountLoginPermissionRequest): QueryAgAccountLoginPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAgAccountLoginPermissionWithOptions(request, runtime);
}

model QueryAgSecurityMobileRequest {
  agAccountType?: string(name='AgAccountType'),
  appName?: string(name='AppName'),
  mpk?: string(name='Mpk'),
  pk?: string(name='Pk'),
}

model QueryAgSecurityMobileResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  securityMobile?: string(name='SecurityMobile'),
  success?: boolean(name='Success'),
}

model QueryAgSecurityMobileResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryAgSecurityMobileResponseBody(name='body'),
}

async function queryAgSecurityMobileWithOptions(request: QueryAgSecurityMobileRequest, runtime: Util.RuntimeOptions): QueryAgSecurityMobileResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agAccountType)) {
    query['AgAccountType'] = request.agAccountType;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAgSecurityMobile',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAgSecurityMobile(request: QueryAgSecurityMobileRequest): QueryAgSecurityMobileResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAgSecurityMobileWithOptions(request, runtime);
}

model QueryBindsByOuterIdRequest {
  appName?: string(name='AppName'),
  minorOuterId?: string(name='MinorOuterId'),
  outerId?: string(name='OuterId'),
  tenantId?: string(name='TenantId'),
}

model QueryBindsByOuterIdResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      bindData?: map[string]any(name='BindData'),
      minorOuterId?: string(name='MinorOuterId'),
      outerId?: string(name='OuterId'),
      pk?: string(name='Pk'),
      status?: string(name='Status'),
      tenantId?: string(name='TenantId'),
    }
  ](name='Data'),
  httpCode?: string(name='HttpCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryBindsByOuterIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryBindsByOuterIdResponseBody(name='body'),
}

async function queryBindsByOuterIdWithOptions(request: QueryBindsByOuterIdRequest, runtime: Util.RuntimeOptions): QueryBindsByOuterIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.minorOuterId)) {
    query['MinorOuterId'] = request.minorOuterId;
  }
  if (!Util.isUnset(request.outerId)) {
    query['OuterId'] = request.outerId;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryBindsByOuterId',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryBindsByOuterId(request: QueryBindsByOuterIdRequest): QueryBindsByOuterIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryBindsByOuterIdWithOptions(request, runtime);
}

model QueryBindsByPkRequest {
  appName?: string(name='AppName'),
  pk?: string(name='Pk'),
  tenantIds?: map[string]any(name='TenantIds'),
}

model QueryBindsByPkShrinkRequest {
  appName?: string(name='AppName'),
  pk?: string(name='Pk'),
  tenantIdsShrink?: string(name='TenantIds'),
}

model QueryBindsByPkResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      bindData?: map[string]any(name='BindData'),
      minorOuterId?: string(name='MinorOuterId'),
      outerId?: string(name='OuterId'),
      pk?: string(name='Pk'),
      status?: string(name='Status'),
      tenantId?: string(name='TenantId'),
    }
  ](name='Data'),
  httpCode?: string(name='HttpCode'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryBindsByPkResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryBindsByPkResponseBody(name='body'),
}

async function queryBindsByPkWithOptions(tmpReq: QueryBindsByPkRequest, runtime: Util.RuntimeOptions): QueryBindsByPkResponse {
  Util.validateModel(tmpReq);
  var request = new QueryBindsByPkShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tenantIds)) {
    request.tenantIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tenantIds, 'TenantIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  if (!Util.isUnset(request.tenantIdsShrink)) {
    query['TenantIds'] = request.tenantIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryBindsByPk',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryBindsByPk(request: QueryBindsByPkRequest): QueryBindsByPkResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryBindsByPkWithOptions(request, runtime);
}

model QueryCustomerLabelRequest {
  labelSeries?: string(name='LabelSeries'),
  PK?: long(name='PK'),
  token?: string(name='Token'),
}

model QueryCustomerLabelResponseBody = {
  code?: string(name='Code'),
  data?: {
    customerLabel?: [ 
    {
      label?: string(name='Label'),
      labelSeries?: string(name='LabelSeries'),
    }
  ](name='CustomerLabel')
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryCustomerLabelResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryCustomerLabelResponseBody(name='body'),
}

async function queryCustomerLabelWithOptions(request: QueryCustomerLabelRequest, runtime: Util.RuntimeOptions): QueryCustomerLabelResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.labelSeries)) {
    query['LabelSeries'] = request.labelSeries;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryCustomerLabel',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryCustomerLabel(request: QueryCustomerLabelRequest): QueryCustomerLabelResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryCustomerLabelWithOptions(request, runtime);
}

model QueryEncryptedAccountProfileInfoRequest {
  havanaId?: string(name='HavanaId'),
  PK?: string(name='PK'),
}

model QueryEncryptedAccountProfileInfoResponseBody = {
  encryptedProfileInfo?: {
    encryptedAliyunID?: string(name='EncryptedAliyunID'),
    encryptedEmail?: string(name='EncryptedEmail'),
    encryptedMobile?: string(name='EncryptedMobile'),
    encryptedSecurityMobile?: string(name='EncryptedSecurityMobile'),
    isAliyunIdAnEmail?: boolean(name='IsAliyunIdAnEmail'),
    pk?: string(name='pk'),
  }(name='EncryptedProfileInfo'),
  requestId?: string(name='RequestId'),
}

model QueryEncryptedAccountProfileInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryEncryptedAccountProfileInfoResponseBody(name='body'),
}

async function queryEncryptedAccountProfileInfoWithOptions(request: QueryEncryptedAccountProfileInfoRequest, runtime: Util.RuntimeOptions): QueryEncryptedAccountProfileInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.havanaId)) {
    query['HavanaId'] = request.havanaId;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryEncryptedAccountProfileInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryEncryptedAccountProfileInfo(request: QueryEncryptedAccountProfileInfoRequest): QueryEncryptedAccountProfileInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryEncryptedAccountProfileInfoWithOptions(request, runtime);
}

model QueryEnterpriseInfoRequest {
  enterpriseVersion?: string(name='EnterpriseVersion'),
  havanaId?: string(name='HavanaId'),
  PK?: string(name='PK'),
}

model QueryEnterpriseInfoResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  profileInfo?: {
    alias?: string(name='Alias'),
    aliyunPK?: string(name='AliyunPK'),
    auditStatus?: string(name='AuditStatus'),
    businessLicenseImgSrc?: string(name='BusinessLicenseImgSrc'),
    businessLicenseNumber?: string(name='BusinessLicenseNumber'),
    businessLicenseType?: string(name='BusinessLicenseType'),
    certifiedFrom?: string(name='CertifiedFrom'),
    certifiedTime?: string(name='CertifiedTime'),
    city?: {
      id?: string(name='Id'),
      name?: string(name='Name'),
    }(name='City'),
    createTime?: string(name='CreateTime'),
    detailAddress?: string(name='DetailAddress'),
    EInterpriseSize?: string(name='EInterpriseSize'),
    enterpriseEntity?: string(name='EnterpriseEntity'),
    entityIDNumber?: string(name='EntityIDNumber'),
    extend?: string(name='Extend'),
    fax?: string(name='Fax'),
    name?: string(name='Name'),
    phone?: string(name='Phone'),
    postalCode?: string(name='PostalCode'),
    profile?: string(name='Profile'),
    province?: {
      id?: string(name='Id'),
      name?: string(name='Name'),
    }(name='Province'),
    updateTime?: string(name='UpdateTime'),
    years?: string(name='Years'),
  }(name='ProfileInfo'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryEnterpriseInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryEnterpriseInfoResponseBody(name='body'),
}

async function queryEnterpriseInfoWithOptions(request: QueryEnterpriseInfoRequest, runtime: Util.RuntimeOptions): QueryEnterpriseInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.enterpriseVersion)) {
    query['EnterpriseVersion'] = request.enterpriseVersion;
  }
  if (!Util.isUnset(request.havanaId)) {
    query['HavanaId'] = request.havanaId;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryEnterpriseInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryEnterpriseInfo(request: QueryEnterpriseInfoRequest): QueryEnterpriseInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryEnterpriseInfoWithOptions(request, runtime);
}

model QueryEnumConfigByTypeRequest {
  type?: string(name='Type'),
}

model QueryEnumConfigByTypeResponseBody = {
  code?: string(name='Code'),
  data?: {
    enumConfig?: [ 
    {
      enumName?: string(name='enumName'),
      enumValue?: string(name='enumValue'),
    }
  ](name='EnumConfig')
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryEnumConfigByTypeResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryEnumConfigByTypeResponseBody(name='body'),
}

async function queryEnumConfigByTypeWithOptions(request: QueryEnumConfigByTypeRequest, runtime: Util.RuntimeOptions): QueryEnumConfigByTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryEnumConfigByType',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryEnumConfigByType(request: QueryEnumConfigByTypeRequest): QueryEnumConfigByTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryEnumConfigByTypeWithOptions(request, runtime);
}

model QueryOneKeyDeleteBlockListRequest {
  appName?: string(name='AppName'),
  pk?: string(name='Pk'),
}

model QueryOneKeyDeleteBlockListResponseBody = {
  code?: string(name='Code'),
  data?: [ 
    {
      blockCode?: string(name='BlockCode'),
      blockMsg?: string(name='BlockMsg'),
    }
  ](name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QueryOneKeyDeleteBlockListResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryOneKeyDeleteBlockListResponseBody(name='body'),
}

async function queryOneKeyDeleteBlockListWithOptions(request: QueryOneKeyDeleteBlockListRequest, runtime: Util.RuntimeOptions): QueryOneKeyDeleteBlockListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryOneKeyDeleteBlockList',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryOneKeyDeleteBlockList(request: QueryOneKeyDeleteBlockListRequest): QueryOneKeyDeleteBlockListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryOneKeyDeleteBlockListWithOptions(request, runtime);
}

model QuerySecurityInfoRequest {
  appName?: string(name='AppName'),
  pk?: string(name='Pk'),
}

model QuerySecurityInfoResponseBody = {
  accountSecurityInfoDto?: {
    aliyunId?: string(name='AliyunId'),
    name?: string(name='Name'),
    nationalityCode?: string(name='NationalityCode'),
    pk?: string(name='Pk'),
    profileType?: string(name='ProfileType'),
    securityEmail?: string(name='SecurityEmail'),
    securityMobile?: string(name='SecurityMobile'),
  }(name='AccountSecurityInfoDto'),
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model QuerySecurityInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QuerySecurityInfoResponseBody(name='body'),
}

async function querySecurityInfoWithOptions(request: QuerySecurityInfoRequest, runtime: Util.RuntimeOptions): QuerySecurityInfoResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QuerySecurityInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function querySecurityInfo(request: QuerySecurityInfoRequest): QuerySecurityInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return querySecurityInfoWithOptions(request, runtime);
}

model RegisterInternalAccountForBucRequest {
  bid?: string(name='Bid'),
  email?: string(name='Email'),
  isEmailConfirmed?: boolean(name='IsEmailConfirmed'),
  isMobileConfirmed?: boolean(name='IsMobileConfirmed'),
  isMobileLogin?: boolean(name='IsMobileLogin'),
  mobile?: string(name='Mobile'),
  nationalityCode?: string(name='NationalityCode'),
  plainPassword?: string(name='PlainPassword'),
  preferredLanguage?: string(name='PreferredLanguage'),
  accountTypeCode?: string(name='accountTypeCode'),
}

model RegisterInternalAccountForBucResponseBody = {
  code?: string(name='Code'),
  data?: {
    accountStatus?: string(name='AccountStatus'),
    accountStructure?: string(name='AccountStructure'),
    extendInfo?: string(name='ExtendInfo'),
    havanaId?: string(name='HavanaId'),
    lastLoginTime?: string(name='LastLoginTime'),
    ownerBid?: string(name='OwnerBid'),
    parentPk?: string(name='ParentPk'),
    partnerPk?: string(name='PartnerPk'),
    pk?: string(name='Pk'),
    site?: string(name='Site'),
  }(name='Data'),
  localizedMessage?: string(name='LocalizedMessage'),
  message?: string(name='Message'),
  msg?: string(name='Msg'),
  requestId?: string(name='RequestId'),
}

model RegisterInternalAccountForBucResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RegisterInternalAccountForBucResponseBody(name='body'),
}

async function registerInternalAccountForBucWithOptions(request: RegisterInternalAccountForBucRequest, runtime: Util.RuntimeOptions): RegisterInternalAccountForBucResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bid)) {
    query['Bid'] = request.bid;
  }
  if (!Util.isUnset(request.email)) {
    query['Email'] = request.email;
  }
  if (!Util.isUnset(request.isEmailConfirmed)) {
    query['IsEmailConfirmed'] = request.isEmailConfirmed;
  }
  if (!Util.isUnset(request.isMobileConfirmed)) {
    query['IsMobileConfirmed'] = request.isMobileConfirmed;
  }
  if (!Util.isUnset(request.isMobileLogin)) {
    query['IsMobileLogin'] = request.isMobileLogin;
  }
  if (!Util.isUnset(request.mobile)) {
    query['Mobile'] = request.mobile;
  }
  if (!Util.isUnset(request.nationalityCode)) {
    query['NationalityCode'] = request.nationalityCode;
  }
  if (!Util.isUnset(request.plainPassword)) {
    query['PlainPassword'] = request.plainPassword;
  }
  if (!Util.isUnset(request.preferredLanguage)) {
    query['PreferredLanguage'] = request.preferredLanguage;
  }
  if (!Util.isUnset(request.accountTypeCode)) {
    query['accountTypeCode'] = request.accountTypeCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RegisterInternalAccountForBuc',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function registerInternalAccountForBuc(request: RegisterInternalAccountForBucRequest): RegisterInternalAccountForBucResponse {
  var runtime = new Util.RuntimeOptions{};
  return registerInternalAccountForBucWithOptions(request, runtime);
}

model ReleaseAgAccountRequest {
  mpk?: string(name='Mpk'),
  pk?: string(name='Pk'),
  releaseReason?: string(name='ReleaseReason'),
}

model ReleaseAgAccountResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ReleaseAgAccountResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ReleaseAgAccountResponseBody(name='body'),
}

async function releaseAgAccountWithOptions(request: ReleaseAgAccountRequest, runtime: Util.RuntimeOptions): ReleaseAgAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  if (!Util.isUnset(request.releaseReason)) {
    query['ReleaseReason'] = request.releaseReason;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ReleaseAgAccount',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function releaseAgAccount(request: ReleaseAgAccountRequest): ReleaseAgAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return releaseAgAccountWithOptions(request, runtime);
}

model ResendAsyncCreateAgAccountRequest {
  mpk?: string(name='Mpk'),
  traceNo?: string(name='TraceNo'),
}

model ResendAsyncCreateAgAccountResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: string(name='Success'),
  traceNo?: string(name='TraceNo'),
}

model ResendAsyncCreateAgAccountResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResendAsyncCreateAgAccountResponseBody(name='body'),
}

async function resendAsyncCreateAgAccountWithOptions(request: ResendAsyncCreateAgAccountRequest, runtime: Util.RuntimeOptions): ResendAsyncCreateAgAccountResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.traceNo)) {
    query['TraceNo'] = request.traceNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResendAsyncCreateAgAccount',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resendAsyncCreateAgAccount(request: ResendAsyncCreateAgAccountRequest): ResendAsyncCreateAgAccountResponse {
  var runtime = new Util.RuntimeOptions{};
  return resendAsyncCreateAgAccountWithOptions(request, runtime);
}

model ResendAsyncModifyLoginEmailRequest {
  mpk?: string(name='Mpk'),
  traceNo?: string(name='TraceNo'),
}

model ResendAsyncModifyLoginEmailResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
  traceNo?: string(name='TraceNo'),
}

model ResendAsyncModifyLoginEmailResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResendAsyncModifyLoginEmailResponseBody(name='body'),
}

async function resendAsyncModifyLoginEmailWithOptions(request: ResendAsyncModifyLoginEmailRequest, runtime: Util.RuntimeOptions): ResendAsyncModifyLoginEmailResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.traceNo)) {
    query['TraceNo'] = request.traceNo;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResendAsyncModifyLoginEmail',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resendAsyncModifyLoginEmail(request: ResendAsyncModifyLoginEmailRequest): ResendAsyncModifyLoginEmailResponse {
  var runtime = new Util.RuntimeOptions{};
  return resendAsyncModifyLoginEmailWithOptions(request, runtime);
}

model SeparateAgRelationRequest {
  mpk?: string(name='Mpk'),
  pk?: string(name='Pk'),
}

model SeparateAgRelationResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model SeparateAgRelationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SeparateAgRelationResponseBody(name='body'),
}

async function separateAgRelationWithOptions(request: SeparateAgRelationRequest, runtime: Util.RuntimeOptions): SeparateAgRelationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SeparateAgRelation',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function separateAgRelation(request: SeparateAgRelationRequest): SeparateAgRelationResponse {
  var runtime = new Util.RuntimeOptions{};
  return separateAgRelationWithOptions(request, runtime);
}

model UpdateAccountAddressInfoRequest {
  address?: string(name='Address'),
  address2?: string(name='Address2'),
  cityJsonString?: map[string]any(name='CityJsonString'),
  PK?: string(name='PK'),
  postCode?: string(name='PostCode'),
  provinceJsonString?: map[string]any(name='ProvinceJsonString'),
}

model UpdateAccountAddressInfoShrinkRequest {
  address?: string(name='Address'),
  address2?: string(name='Address2'),
  cityJsonStringShrink?: string(name='CityJsonString'),
  PK?: string(name='PK'),
  postCode?: string(name='PostCode'),
  provinceJsonStringShrink?: string(name='ProvinceJsonString'),
}

model UpdateAccountAddressInfoResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateAccountAddressInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateAccountAddressInfoResponseBody(name='body'),
}

async function updateAccountAddressInfoWithOptions(tmpReq: UpdateAccountAddressInfoRequest, runtime: Util.RuntimeOptions): UpdateAccountAddressInfoResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateAccountAddressInfoShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.cityJsonString)) {
    request.cityJsonStringShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.cityJsonString, 'CityJsonString', 'json');
  }
  if (!Util.isUnset(tmpReq.provinceJsonString)) {
    request.provinceJsonStringShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.provinceJsonString, 'ProvinceJsonString', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.address2)) {
    query['Address2'] = request.address2;
  }
  if (!Util.isUnset(request.cityJsonStringShrink)) {
    query['CityJsonString'] = request.cityJsonStringShrink;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  if (!Util.isUnset(request.postCode)) {
    query['PostCode'] = request.postCode;
  }
  if (!Util.isUnset(request.provinceJsonStringShrink)) {
    query['ProvinceJsonString'] = request.provinceJsonStringShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAccountAddressInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateAccountAddressInfo(request: UpdateAccountAddressInfoRequest): UpdateAccountAddressInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAccountAddressInfoWithOptions(request, runtime);
}

model UpdateAccountProfileInfoRequest {
  accountAttribute?: string(name='AccountAttribute'),
  address?: string(name='Address'),
  address2?: string(name='Address2'),
  bindAlipayNo?: string(name='BindAlipayNo'),
  certType?: string(name='CertType'),
  cityJsonString?: map[string]any(name='CityJsonString'),
  contactMethod?: string(name='ContactMethod'),
  fax?: string(name='Fax'),
  firstName?: string(name='FirstName'),
  head?: string(name='Head'),
  lastName?: string(name='LastName'),
  PK?: string(name='PK'),
  phone?: string(name='Phone'),
  postCode?: string(name='PostCode'),
  provinceJsonString?: map[string]any(name='ProvinceJsonString'),
  trueName?: string(name='TrueName'),
}

model UpdateAccountProfileInfoShrinkRequest {
  accountAttribute?: string(name='AccountAttribute'),
  address?: string(name='Address'),
  address2?: string(name='Address2'),
  bindAlipayNo?: string(name='BindAlipayNo'),
  certType?: string(name='CertType'),
  cityJsonStringShrink?: string(name='CityJsonString'),
  contactMethod?: string(name='ContactMethod'),
  fax?: string(name='Fax'),
  firstName?: string(name='FirstName'),
  head?: string(name='Head'),
  lastName?: string(name='LastName'),
  PK?: string(name='PK'),
  phone?: string(name='Phone'),
  postCode?: string(name='PostCode'),
  provinceJsonStringShrink?: string(name='ProvinceJsonString'),
  trueName?: string(name='TrueName'),
}

model UpdateAccountProfileInfoResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateAccountProfileInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateAccountProfileInfoResponseBody(name='body'),
}

async function updateAccountProfileInfoWithOptions(tmpReq: UpdateAccountProfileInfoRequest, runtime: Util.RuntimeOptions): UpdateAccountProfileInfoResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateAccountProfileInfoShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.cityJsonString)) {
    request.cityJsonStringShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.cityJsonString, 'CityJsonString', 'json');
  }
  if (!Util.isUnset(tmpReq.provinceJsonString)) {
    request.provinceJsonStringShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.provinceJsonString, 'ProvinceJsonString', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.accountAttribute)) {
    query['AccountAttribute'] = request.accountAttribute;
  }
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.address2)) {
    query['Address2'] = request.address2;
  }
  if (!Util.isUnset(request.bindAlipayNo)) {
    query['BindAlipayNo'] = request.bindAlipayNo;
  }
  if (!Util.isUnset(request.certType)) {
    query['CertType'] = request.certType;
  }
  if (!Util.isUnset(request.cityJsonStringShrink)) {
    query['CityJsonString'] = request.cityJsonStringShrink;
  }
  if (!Util.isUnset(request.contactMethod)) {
    query['ContactMethod'] = request.contactMethod;
  }
  if (!Util.isUnset(request.fax)) {
    query['Fax'] = request.fax;
  }
  if (!Util.isUnset(request.firstName)) {
    query['FirstName'] = request.firstName;
  }
  if (!Util.isUnset(request.head)) {
    query['Head'] = request.head;
  }
  if (!Util.isUnset(request.lastName)) {
    query['LastName'] = request.lastName;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  if (!Util.isUnset(request.phone)) {
    query['Phone'] = request.phone;
  }
  if (!Util.isUnset(request.postCode)) {
    query['PostCode'] = request.postCode;
  }
  if (!Util.isUnset(request.provinceJsonStringShrink)) {
    query['ProvinceJsonString'] = request.provinceJsonStringShrink;
  }
  if (!Util.isUnset(request.trueName)) {
    query['TrueName'] = request.trueName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAccountProfileInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateAccountProfileInfo(request: UpdateAccountProfileInfoRequest): UpdateAccountProfileInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAccountProfileInfoWithOptions(request, runtime);
}

model UpdateAgServiceStatusRequest {
  agAccountType?: string(name='AgAccountType'),
  mpk?: string(name='Mpk'),
  status?: string(name='Status'),
}

model UpdateAgServiceStatusResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateAgServiceStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateAgServiceStatusResponseBody(name='body'),
}

async function updateAgServiceStatusWithOptions(request: UpdateAgServiceStatusRequest, runtime: Util.RuntimeOptions): UpdateAgServiceStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agAccountType)) {
    query['AgAccountType'] = request.agAccountType;
  }
  if (!Util.isUnset(request.mpk)) {
    query['Mpk'] = request.mpk;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAgServiceStatus',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateAgServiceStatus(request: UpdateAgServiceStatusRequest): UpdateAgServiceStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAgServiceStatusWithOptions(request, runtime);
}

model UpdateCustomerCategoryRequest {
  paramList?: string(name='ParamList'),
  userId?: long(name='UserId'),
}

model UpdateCustomerCategoryResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateCustomerCategoryResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateCustomerCategoryResponseBody(name='body'),
}

async function updateCustomerCategoryWithOptions(request: UpdateCustomerCategoryRequest, runtime: Util.RuntimeOptions): UpdateCustomerCategoryResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.paramList)) {
    query['ParamList'] = request.paramList;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCustomerCategory',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateCustomerCategory(request: UpdateCustomerCategoryRequest): UpdateCustomerCategoryResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCustomerCategoryWithOptions(request, runtime);
}

model UpdateCustomerInformationRequest {
  biz?: string(name='Biz'),
  customerCategory?: string(name='CustomerCategory'),
  customerSubCategory?: string(name='CustomerSubCategory'),
  userId?: long(name='UserId'),
  website?: string(name='Website'),
}

model UpdateCustomerInformationResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateCustomerInformationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateCustomerInformationResponseBody(name='body'),
}

async function updateCustomerInformationWithOptions(request: UpdateCustomerInformationRequest, runtime: Util.RuntimeOptions): UpdateCustomerInformationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.biz)) {
    query['Biz'] = request.biz;
  }
  if (!Util.isUnset(request.customerCategory)) {
    query['CustomerCategory'] = request.customerCategory;
  }
  if (!Util.isUnset(request.customerSubCategory)) {
    query['CustomerSubCategory'] = request.customerSubCategory;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  if (!Util.isUnset(request.website)) {
    query['Website'] = request.website;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCustomerInformation',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateCustomerInformation(request: UpdateCustomerInformationRequest): UpdateCustomerInformationResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCustomerInformationWithOptions(request, runtime);
}

model UpdateOrInsertEnterpriseInfoRequest {
  address?: string(name='Address'),
  alias?: string(name='Alias'),
  cityJsonString?: map[string]any(name='CityJsonString'),
  enterpriseSize?: string(name='EnterpriseSize'),
  fax?: string(name='Fax'),
  name?: string(name='Name'),
  PK?: string(name='PK'),
  phone?: string(name='Phone'),
  provinceJsonString?: map[string]any(name='ProvinceJsonString'),
  years?: string(name='Years'),
}

model UpdateOrInsertEnterpriseInfoShrinkRequest {
  address?: string(name='Address'),
  alias?: string(name='Alias'),
  cityJsonStringShrink?: string(name='CityJsonString'),
  enterpriseSize?: string(name='EnterpriseSize'),
  fax?: string(name='Fax'),
  name?: string(name='Name'),
  PK?: string(name='PK'),
  phone?: string(name='Phone'),
  provinceJsonStringShrink?: string(name='ProvinceJsonString'),
  years?: string(name='Years'),
}

model UpdateOrInsertEnterpriseInfoResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model UpdateOrInsertEnterpriseInfoResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateOrInsertEnterpriseInfoResponseBody(name='body'),
}

async function updateOrInsertEnterpriseInfoWithOptions(tmpReq: UpdateOrInsertEnterpriseInfoRequest, runtime: Util.RuntimeOptions): UpdateOrInsertEnterpriseInfoResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateOrInsertEnterpriseInfoShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.cityJsonString)) {
    request.cityJsonStringShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.cityJsonString, 'CityJsonString', 'json');
  }
  if (!Util.isUnset(tmpReq.provinceJsonString)) {
    request.provinceJsonStringShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.provinceJsonString, 'ProvinceJsonString', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.address)) {
    query['Address'] = request.address;
  }
  if (!Util.isUnset(request.alias)) {
    query['Alias'] = request.alias;
  }
  if (!Util.isUnset(request.cityJsonStringShrink)) {
    query['CityJsonString'] = request.cityJsonStringShrink;
  }
  if (!Util.isUnset(request.enterpriseSize)) {
    query['EnterpriseSize'] = request.enterpriseSize;
  }
  if (!Util.isUnset(request.fax)) {
    query['Fax'] = request.fax;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.PK)) {
    query['PK'] = request.PK;
  }
  if (!Util.isUnset(request.phone)) {
    query['Phone'] = request.phone;
  }
  if (!Util.isUnset(request.provinceJsonStringShrink)) {
    query['ProvinceJsonString'] = request.provinceJsonStringShrink;
  }
  if (!Util.isUnset(request.years)) {
    query['Years'] = request.years;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateOrInsertEnterpriseInfo',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateOrInsertEnterpriseInfo(request: UpdateOrInsertEnterpriseInfoRequest): UpdateOrInsertEnterpriseInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateOrInsertEnterpriseInfoWithOptions(request, runtime);
}

model DoLogicalDeleteResourceRequest {
  bid?: string(name='Bid'),
  country?: string(name='Country'),
  gmtWakeup?: string(name='GmtWakeup'),
  hid?: long(name='Hid'),
  interrupt?: boolean(name='Interrupt'),
  invoker?: string(name='Invoker'),
  message?: string(name='Message'),
  pk?: string(name='Pk'),
  success?: boolean(name='Success'),
  taskExtraData?: string(name='TaskExtraData'),
  taskIdentifier?: string(name='TaskIdentifier'),
}

model DoLogicalDeleteResourceResponseBody = {
  bid?: string(name='Bid'),
  country?: string(name='Country'),
  gmtWakeup?: string(name='GmtWakeup'),
  hid?: long(name='Hid'),
  interrupt?: boolean(name='Interrupt'),
  invoker?: string(name='Invoker'),
  message?: string(name='Message'),
  pk?: string(name='Pk'),
  success?: boolean(name='Success'),
  taskExtraData?: string(name='TaskExtraData'),
  taskIdentifier?: string(name='TaskIdentifier'),
}

model DoLogicalDeleteResourceResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DoLogicalDeleteResourceResponseBody(name='body'),
}

async function doLogicalDeleteResourceWithOptions(request: DoLogicalDeleteResourceRequest, runtime: Util.RuntimeOptions): DoLogicalDeleteResourceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bid)) {
    query['Bid'] = request.bid;
  }
  if (!Util.isUnset(request.country)) {
    query['Country'] = request.country;
  }
  if (!Util.isUnset(request.gmtWakeup)) {
    query['GmtWakeup'] = request.gmtWakeup;
  }
  if (!Util.isUnset(request.hid)) {
    query['Hid'] = request.hid;
  }
  if (!Util.isUnset(request.interrupt)) {
    query['Interrupt'] = request.interrupt;
  }
  if (!Util.isUnset(request.invoker)) {
    query['Invoker'] = request.invoker;
  }
  if (!Util.isUnset(request.message)) {
    query['Message'] = request.message;
  }
  if (!Util.isUnset(request.pk)) {
    query['Pk'] = request.pk;
  }
  if (!Util.isUnset(request.success)) {
    query['Success'] = request.success;
  }
  if (!Util.isUnset(request.taskExtraData)) {
    query['TaskExtraData'] = request.taskExtraData;
  }
  if (!Util.isUnset(request.taskIdentifier)) {
    query['TaskIdentifier'] = request.taskIdentifier;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'doLogicalDeleteResource',
    version = '2016-06-06',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function doLogicalDeleteResource(request: DoLogicalDeleteResourceRequest): DoLogicalDeleteResourceResponse {
  var runtime = new Util.RuntimeOptions{};
  return doLogicalDeleteResourceWithOptions(request, runtime);
}

